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

Discussion in 'ASP .Net Web Controls' started by Allan Ebdrup, Jan 18, 2006.

  1. Allan Ebdrup

    Allan Ebdrup Guest

    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
    Allan Ebdrup, Jan 18, 2006
    #1
    1. Advertising

  2. 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, Jan 18, 2006
    #2
    1. Advertising

  3. Allan Ebdrup

    Allan Ebdrup Guest

    "Keith Patrick" <> wrote in message
    news:%...
    > 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
    Allan Ebdrup, Jan 19, 2006
    #3
  4. Allan Ebdrup

    Allan Ebdrup Guest

    Allan Ebdrup, Jan 19, 2006
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. RC
    Replies:
    2
    Views:
    426
    Malte
    May 10, 2005
  2. shruds
    Replies:
    1
    Views:
    783
    John C. Bollinger
    Jan 27, 2006
  3. Luis Ramírez.

    Can a webcontrol (webcontrol.dll) have a configuration file?

    Luis Ramírez., Jul 5, 2004, in forum: ASP .Net Building Controls
    Replies:
    2
    Views:
    195
    Luis Ramírez
    Jul 6, 2004
  4. Kasabaarde Sumta

    WebControl inside of WebControl and attaching events

    Kasabaarde Sumta, Dec 13, 2004, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    183
    Kasabaarde Sumta
    Dec 13, 2004
  5. Fabricio

    Custom webcontrol that references another webcontrol

    Fabricio, Sep 21, 2005, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    176
    Fabricio
    Sep 21, 2005
Loading...

Share This Page