I apologize in advance, I feel sure this question has been answered many many times. I cannot, however, seem to find the magical combination of search keywords to yield my answer.
I am trying to create a custom webcontrol which has some children, which then have properties. Here is something similar to what I want my webcontrol to do:
<uc1:MyControl ID="myControl1" runat="server"> <uc1:MyItem Label="Label1"> Just some text. <asp:Label ID="lbl_Test1" Text="Test1" runat="server" /> </uc1:MyItem> <uc1:MyItem Label="Label2"> Some more text. <asp:Label ID="lbl_Test2" Text="Test2" runat="server" /> </uc1:MyItem> </uc1:MyControl>
In a way this is a bit similar to DropDownList (ListItem). Except the example above has children which can also contain controls. The example above could be used to ultimately create a custom TabStrip / Tab control.
My question is kind of general. How do you create a webcontrol which can contain children, which have properties and which can also contain children?
CorkNBeans
Member
210 Points
42 Posts
Custom WebControl - Children, Properties, etc.
Jan 20, 2006 08:30 PM|LINK
I apologize in advance, I feel sure this question has been answered many many times. I cannot, however, seem to find the magical combination of search keywords to yield my answer.
I am trying to create a custom webcontrol which has some children, which then have properties. Here is something similar to what I want my webcontrol to do:
In a way this is a bit similar to DropDownList (ListItem). Except the example above has children which can also contain controls. The example above could be used to ultimately create a custom TabStrip / Tab control.
My question is kind of general. How do you create a webcontrol which can contain children, which have properties and which can also contain children?
Gabe
==============
CorkNBeans
Member
210 Points
42 Posts
Re: Custom WebControl - Children, Properties, etc.
Jan 20, 2006 09:18 PM|LINK
Ok, I think I got this solved. Consider this:
test.aspx:
Tabs.cs