Hi,

I have a toolbar and panel in my UI. I have created ajax event on toolbar item click. On the toolbar item click I wat to create a user control and add it to the panel. I used the following code.




var wc1 = LoadControl("ControlName");


wc1.ID = "wc1";


PanelMainBody.BodyContainer.Controls.Add(wc1);
The control is not diaplayed. If I copy the code in the Page OnInit method, the control is displayed. What I have missed?

Thanks