[CLOSED] Adding UserControl dynamically in code-behind

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    [CLOSED] Adding UserControl dynamically in code-behind

    Hey,
    I read a few posts here and also on the net about ASP.NET in general, but cant figure out how to dynamically add UserControls in code-behind.

    I want to add my custom UserControl "CoreComment" to a Panel I have.

    This is what I tried:

    UserControls.CoreComment cc = new UserControls.CoreComment();
    cc._Comment = c;
    PanelComments.Controls.Add(cc);
    Here I see no controls rendered. I also tried to add "cc.RenderControl(...)" but I dont really know what or how to use/get a HtmlTextWriter or if that is the right way to go.

    Any help is appreciated =)
    Last edited by Daniil; May 17, 2011 at 9:49 PM. Reason: [CLOSED]

Similar Threads

  1. Replies: 14
    Last Post: Nov 16, 2012, 10:01 AM
  2. [CLOSED] Managing events from a dynamically loaded UserControl
    By egvt in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Feb 20, 2012, 4:49 PM
  3. Replies: 4
    Last Post: Jul 07, 2011, 12:40 PM
  4. Replies: 2
    Last Post: Oct 04, 2010, 7:36 AM
  5. Replies: 3
    Last Post: Mar 30, 2010, 1:03 PM

Tags for this Thread

Posting Permissions