Friday, December 26, 2008

How to dynamically add Update Panel to asp.net page?

Here is a simple code to dynamically add update panel to asp.net page:



UpdatePanel upannel = new UpdatePanel();
upannel.ChildrenAsTriggers = true;
upannel.UpdateMode = UpdatePanelUpdateMode.Conditional;
upannel.ID = "updatePannel_1";
upannel.ContentTemplateContainer.Controls.Add("Control_TO_Add_In_Update_Panel");
Page.Form.Controls.Add(upannel);

Hope this helps you :)

0 comments:

Post a Comment