I want to generate this:
<x:MyControl id="a" runat="server">
<Scripts>
<x:MyScript .. />
</Scripts>
</x:MyControl>
I setup a control like:
[
ParseChildren(true, "Scripts"),
DefaultProperty("Scripts")
]
public class MyControl: Control
{
[
PersistenceMode(PersistenceMode.InnerDefaultProperty),
MergableProperty(false)
]
public MyScriptCollection Scripts
{
get { return _scripts; }
set { _scripts = value; }
}
}
But this isn’t working… It won’t let me create a list of scripts… what is wrong with my definition?
EDIT: Also, MyScript objects in the MyScriptCollection does not inherit from the control base class.
Thanks.
It seems like there is an issue if children aren’t custom controls at times, especially with more complex markup in controls and longer inheritance trees. Not always the case, but for me it seems consistent.
Maybe this is a bug, maybe not.