I can see from other people’s controls that it is possible to set sub-object properites in markup. For example, if I’m using Telerik’s RadComboBox I can write …
<telerik:RadComboBox runat="server" ID="RadComboBox2">
<CollapseAnimation Duration="100" />
</telerik:RadComboBox>
or, alternatively I can write…
<telerik:RadComboBox runat="server" ID="RadComboBox2" CollapseAnimation-Duration="100">
</telerik:RadComboBox>
What technique do I have to emply to allow me to do this with controls I write? I thought that I might have to explicitly create properties in my parent control for each of the of properties my sub-object I expose. However, I don’t seem to allowed to create a property with a ‘-‘ in the name.
Try this:
1 – Property Class Definition
2 – UserControl Definition
3 – Markup:
or
Note: You have to reference the usercontrol assembly first with your own tagPrefix.