custom container control - wrapping child controls

Discussion in 'ASP .Net' started by gerry, Jul 22, 2008.

  1. gerry

    gerry Guest

    I am trying to create a custom container control that will only ever contain
    a specific type of control.
    At design time, when a control of a different type is added to the container
    I would like to wrap the control in the proper control type - which is also
    a container.

    At design time I want to be able to turn this :

    <my:container>
    <asp:textbox />
    </my:container>

    into this :

    <my:container>
    <my:wrapper>
    <asp:textbox />
    </my:wrapper>
    </my:container>

    It is no problem to detect what type of object is being added to the control
    and I can do the wrapping easy enough for the rendered control , but I can't
    see how to change the physical markup as displayed in the designer and
    stored in the .aspx file.

    Webparts does something similar but it looks like the designer source has
    not been made available.

    Anyone know how to do this or have any ideas on how this might be done ?

    Gerry
     
    gerry, Jul 22, 2008
    #1
    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. Chris Newby
    Replies:
    1
    Views:
    478
    Vaibhav
    Feb 25, 2005
  2. Jeff Rodriguez
    Replies:
    23
    Views:
    1,130
    David Schwartz
    Dec 9, 2003
  3. Chad Scharf
    Replies:
    3
    Views:
    886
    Chad Scharf
    Oct 18, 2007
  4. gerry
    Replies:
    5
    Views:
    476
    gerry
    Aug 6, 2008
  5. Replies:
    0
    Views:
    207
Loading...

Share This Page