Hello
I am written a User Control. in the User Control, There are Header and Footer.
i want insert gridview or any Control , in Content of the User control.
for a Example:
<Menu:Menu id="1" runAt="Server">
<Asp:GridView ...> /// or any control
</Menu>
Thanks
views:
53answers:
3
A:
Use a Placeholder control.
<Menu:Menu id="1" runAt="Server">
<asp:Placeholder id="phControl" runat="server" />
</Menu>
And in your code-behind:
TextBox myText = new TextBox();
phControl.Controls.Add(myText);
Ravish
2009-09-06 07:28:43
If you cannot put a control inside the usercontrol, you can't even put a placeholder there.
gius
2009-09-06 07:54:31
+1
A:
Have a look at this example to create your own Templated Controls:
http://msdn.microsoft.com/en-us/library/ms178657.aspx
This way you can create a WebControl that can contain templates where you place any control.
Mark Redman
2009-09-06 12:29:23