Dynamically Adding User Control with Child User Control

Discussion in 'ASP .Net Building Controls' started by Travis Pruitt, Jan 13, 2005.

  1. I have a user control that has a child user control. If I drag this
    onto the page, it appears and functions normally.

    If I attempt to add the user control to a page dynamically, I get the
    static content, but the child user control does not appear to render.

    Any ideas on how I can fix this?

    I'm dynamically creating the control using:

    ReportControl_ascx rc =
    (ReportControl_ascx)Page.LoadControl("UserControls/ReportControl.ascx");
    rc.ReportInfo = e.SelectedReport;

    Control contentCtrl =
    this.Master.FindControl("ContentPlaceHolderMain");
    contentCtrl.Controls.Add(rc);
     
    Travis Pruitt, Jan 13, 2005
    #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. ravi sankar

    Dynamically Adding User Control

    ravi sankar, Aug 29, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    500
    Ram sundar
    Aug 29, 2003
  2. Jeff Rodriguez
    Replies:
    23
    Views:
    1,180
    David Schwartz
    Dec 9, 2003
  3. =?Utf-8?B?bmV3R3V5?=
    Replies:
    3
    Views:
    1,112
    =?Utf-8?B?bmV3R3V5?=
    Sep 6, 2007
  4. caldera

    Placeholder child of child control event problem.

    caldera, May 27, 2004, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    223
  5. Replies:
    0
    Views:
    221
Loading...

Share This Page