Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Building Controls > Dynamically Adding User Control with Child User Control

Reply
Thread Tools

Dynamically Adding User Control with Child User Control

 
 
Travis Pruitt
Guest
Posts: n/a
 
      01-13-2005
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);

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
REPOST: Adding child elements to user control declaration =?Utf-8?B?bmV3R3V5?= ASP .Net 3 09-06-2007 03:08 PM
Parent/Child relations - Trying to access child control for save tnt_lu@hotmail.com ASP .Net Datagrid Control 0 04-15-2005 12:50 PM
Load User Control Dynamically, Cast object dynamically =?Utf-8?B?UmV6YSBOYWJp?= ASP .Net 1 03-05-2005 12:04 AM
Placeholder child of child control event problem. caldera ASP .Net Building Controls 1 05-28-2004 07:56 AM
How do I: Main thread spawn child threads, which child processes...control those child processes? Jeff Rodriguez C Programming 23 12-09-2003 11:06 PM



Advertisments