|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How do I create a custom webcontrol that can have xml inside it's tag?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 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. "Keith Patrick" <richard_keith_patrick@nospam.hotmail.com> wrote in message Thanks,news:%235ZRPNHHGHA.1028@TK2MSFTNGP11.phx.gbl... > 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. 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/default.asp?url=/library/en-us/cpguide/html/cpconwebformscontrolbuilderoverview.asp http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconcreatingcustomcontrolbuilder.asp http://samples.gotdotnet.com/quickstart/util/srcview.aspx?path=/quickstart/aspplus/samples/webforms/ctrlauth/customparsing/CustomParse2.src&file=CS\CustomParse2.cs&font=3 I've tried to get the sample:
http://samples.gotdotnet.com/quickstart/util/srcview.aspx?path=/quickstart/aspplus/samples/webforms/ctrlauth/templates/Repeater1.src&file=CS\Repeater1.aspx&font=3 to work but it keeps saying that The TemplateControlSamples:Repeater1 tag in the aspx page cant have content between it's opening and closing tags. What am I doing wrong?
Help with GridView Update w/ Object Data Source needed
XHTML 1.1 and DIV 1 pixel in height ViewState properties and mapped properties don't work well togethe Menu Control and Page Validation Dependent GridViews And CommandArguments how to get changed text from web control textbox A bug? Transparent Dynamic Item! Dropdownlist causes blank screen Calendar control to display image on Mondays Adding errors by hand to a validationsummary? |
|||||||||||||||||||||||