0

In asp.net project, I am trying to add controls to the panel in C# on a button click event

When I put a debugger breakpoint then I can see the item being added but when the page is shown on the browser, the panel is emptyu.

I've tried adding !Page.PostBack but still no luck.

Am I missing something?

protected void Test(object sender, DirectEventArgs e) {

            Panel configurationPanel = new Panel();
            configurationPanel.Title = "My Added Panel";

            configurationPanel.Height = 100;


            pnlInfo.Items.Add(configurationPanel);


    }

Hits the break point and pnlInfo.Items.Count = 1 but it does not show on the page.

InfoLearner
  • 14,952
  • 20
  • 76
  • 124

1 Answers1

0

did u try

  pnlInfo.Controls.Add(configurationPanel);
Nitin Sawant
  • 7,278
  • 9
  • 52
  • 98
  • post ur aspx and aspx.cs code here... try using 'PlaceHolder' instead Panel, Check this [tutorial](http://msdn.microsoft.com/en-us/library/kyt0fzt1%28v=VS.85%29.aspx) – Nitin Sawant Jun 07 '11 at 05:36