Adding a usercontrol to a WebControl

Discussion in 'ASP .Net Web Controls' started by John Giblin, Aug 6, 2003.

  1. John Giblin

    John Giblin Guest

    I am trying to add a usercontrol to my webcontrol and I seem to be
    stuck. I see the method add in the control, but I cannot add the user
    control that way. Any Ideas. Is it possible
     
    John Giblin, Aug 6, 2003
    #1
    1. Advertising

  2. John Giblin

    John Giblin Guest

    Just in case someone else is looking for this,. here is what I did.

    To get the usercontrol
    UserControl usercontrol
    =(UserControl)Page.LoadControl("~/usercontrols/common/Event_Add.ascx"
    );
    this.Controls.Add(usercontrol);


    protected override void RenderContents(HtmlTextWriter writer)
    {
    foreach (UserControl current in this.Controls)
    {
    current.RenderControl(writer);

    }
    }
    "John Giblin" <> wrote in message news:<#>...
    > I am trying to add a usercontrol to my webcontrol and I seem to be
    > stuck. I see the method add in the control, but I cannot add the user
    > control that way. Any Ideas. Is it possible
     
    John Giblin, Aug 7, 2003
    #2
    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. huobazi
    Replies:
    1
    Views:
    711
    David Waz...
    Jul 3, 2003
  2. Guest
    Replies:
    2
    Views:
    737
  3. John Giblin

    Adding a usercontrol to a WebControl

    John Giblin, Aug 5, 2003, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    121
    John Giblin
    Aug 5, 2003
  4. 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:
    203
    Luis Ramírez
    Jul 6, 2004
  5. Steven

    Adding a WebControl to a WebControl

    Steven, Oct 13, 2008, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    118
    Steven
    Oct 13, 2008
Loading...

Share This Page