How do I create a custom webcontrol that can have xml inside it's tag?

A

Allan Ebdrup

How do I create a custom webcontrol that can have xml inside it's tag?
I mean a control like the repeater control, where I can specify special tags
that define the header body and footer of the control.
I'm thinking of something like:
<uc1:CustomControl ID="Control1" runat="server">
<Header>Some text and perhaps other controls</Header>
<Body>Some more text</Body>
<Footer>Even more text</Footer>
</uc1:CustomControl>

Is there a technical term for this? I haven't been able to find information
about this.

Kind Regards,
Allan Ebdrup
 
K

Keith Patrick

ParseChildrenAttribute(false) should get you started. ASP.Net by default
tries to deserialize child markup to the owning object, but if you disable
child parsing, you can control it yourself.
 
A

Allan Ebdrup

Keith Patrick said:
ParseChildrenAttribute(false) should get you started. ASP.Net by default
tries to deserialize child markup to the owning object, but if you disable
child parsing, you can control it yourself.

Thanks,
I've found that I need to create a custom Control Builder for my control,
since creating a custom control builder runs at compiletime while overriding
..AddSubParsedObject runs at runtime. The samples I've found online aren't
very informative, I haven't found examples that explain how I can create a
Control Builder that finds custom tags inside its tags and handles them like
the repeater control.
Any help on creating custom control builders is appreciated.
I'll keep investigating.

some of the links I've looked at:
http://msdn.microsoft.com/library/d.../html/cpconwebformscontrolbuilderoverview.asp

http://msdn.microsoft.com/library/d...de/html/cpconcreatingcustomcontrolbuilder.asp

http://samples.gotdotnet.com/quicks...stomParse2.src&file=CS\CustomParse2.cs&font=3
 

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,968
Messages
2,570,150
Members
46,697
Latest member
AugustNabo

Latest Threads

Top