G
gozza
Hi,
I am developing couple of custom controls and I can't really figure out what
I need to do for one of them to be parsed appropriately.
This is what I want to achieve: in the aspx file, I would have the code:
<cc:ControlA attr1="val1">
<cc:ControlB attiba="valx" />
<cc:ControlB attiba="valy" />
<cc:ControlB attiba="valz">
<SomeTemplate>
<!-- some html sequence -->
</SomeTemplate>
</cc:ControlB>
</cc:ControlA>
The class ControlA has the attribute ParseChildren set to true:
[ParseChildren(true,"ACollectionProperty")]
The class ControlB has the attribute ParseChildren set to true as well:
[ParseChildren(true)]
Of course, I also have ITemplate property SomeTemplate for the ControlB.
Now if I change the ParseChildren attribute to false for the parent
ControlA, I expected that in a IParserAccessor.AddParsedSubObject override I
would get a number of ControlB objects. As it turns out, I only get one
Literal control for the whole lot. But if I actually put an ASP.NET button
inside ControlA, the button does get parsed, created and passed in.
Now I am not sure if it's a matter of implementing a custom ControlBuilder?
I did try using one of the existing ControlBuilders (it sais in the
documentation that by default, all controls are associated with a
ControlBuilder AND a UserControlControlBuilder?!), but no luck so far?!
Any help will be appreciated.
Thank you,
Gozza
I am developing couple of custom controls and I can't really figure out what
I need to do for one of them to be parsed appropriately.
This is what I want to achieve: in the aspx file, I would have the code:
<cc:ControlA attr1="val1">
<cc:ControlB attiba="valx" />
<cc:ControlB attiba="valy" />
<cc:ControlB attiba="valz">
<SomeTemplate>
<!-- some html sequence -->
</SomeTemplate>
</cc:ControlB>
</cc:ControlA>
The class ControlA has the attribute ParseChildren set to true:
[ParseChildren(true,"ACollectionProperty")]
The class ControlB has the attribute ParseChildren set to true as well:
[ParseChildren(true)]
Of course, I also have ITemplate property SomeTemplate for the ControlB.
Now if I change the ParseChildren attribute to false for the parent
ControlA, I expected that in a IParserAccessor.AddParsedSubObject override I
would get a number of ControlB objects. As it turns out, I only get one
Literal control for the whole lot. But if I actually put an ASP.NET button
inside ControlA, the button does get parsed, created and passed in.
Now I am not sure if it's a matter of implementing a custom ControlBuilder?
I did try using one of the existing ControlBuilders (it sais in the
documentation that by default, all controls are associated with a
ControlBuilder AND a UserControlControlBuilder?!), but no luck so far?!
Any help will be appreciated.
Thank you,
Gozza