Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Adding a usercontrol to a WebControl

Reply
Thread Tools

Adding a usercontrol to a WebControl

 
 
John Giblin
Guest
Posts: n/a
 
      08-06-2003
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


 
Reply With Quote
 
 
 
 
John Giblin
Guest
Posts: n/a
 
      08-07-2003
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" <(E-Mail Removed)> wrote in message news:<#(E-Mail Removed)>...
> 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

 
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
Adding a WebControl to a WebControl Steven ASP .Net Web Controls 1 10-13-2008 09:37 PM
Trapping an Exception ocurring in a Webcontrol at the Page or parent WebControl level. ASP .Net 2 01-31-2005 06:34 PM
Can a webcontrol (webcontrol.dll) have a configuration file? Luis Ramírez. ASP .Net Building Controls 2 07-06-2004 04:35 PM
Adding a usercontrol to a WebControl John Giblin ASP .Net Building Controls 0 08-05-2003 08:35 PM
Use LoadControl to load a usercontrol but the webcontrol in the usercontrol can not AutoPostBack huobazi ASP .Net 1 07-03-2003 03:14 AM



Advertisments