Inner content persistance

M

Mark

In my custom control I am parsing sub properties between my controls tags.
The elements in between the tags should form a collection property but will
also contain controls themselves. In this scenario I am slightly confused as
it appears you should use ParseChildren(true, "<defaultproperty>") when the
inner content is to be parsed as properties or PersistChildren(true) when the
inner content is to be parsed as controls. What if you want both conditions?

One way I have implemented this is to parse the inner contents using
ParseChildren(true) and then to override CreateChildControls method and add
the inner controls through the property collection to the control tree. When
using ParseChildren(true) the method AddParseSubObject does not fire and
therefore how should I inspect the contents between my tags when they are
parsed so that I can test declarative attributes and raise exceptions if
required. Should I be looking to override the ControlBuilder class?

Any help would be much appreciated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top