Quick tip: Templated controls
If you create a templated server control, import it into your web-site or web application and you want to do:
1 2 3 4 5 |
<my:Control ID="myControl" runat="server"> <ItemTemplate> Some text, html or whatever. </ItemTemplate> </myControl> |
and you are allowed to do only:
1 |
<my:Control ID="myControl" runat="server" /> |
you need to modify your ItemTemplate property to look like this:
1 2 3 4 5 6 7 |
[TemplateContainer(typeof(MyTemplateControl))] [Browsable(false)] [PersistenceMode(PersistenceMode.InnerProperty)] public ITemplate ItemTemplate { get { ... } set { ... } } |