I’m trying to develop a custom control for asp.net that will have the following markup:
<bk:ControlMenu ID="cmTest" runat="server" Width="400px">
<Items>
<asp:Textbox>
<asp:Checkbox>
[ List of controls... ]
</Items>
</bk:ControlMenu>
What kind of property will allow me to do this when I’m developing my control? (The items collection being the part in question).
You can’t have nested elements in a standard Web User Control. You’ll need to develop a custom server control to achieve that. To allow nested elements in a custom server control, you need to use the
PersistenceModeattribute and set it toInnerProperty.Here’s an example from a control that I created:
ScheduleGrid control
ScheduleGridColumn class
ScheduleGridColumnCollection class