interviews.dotnetthread.com

↑ Grab this Headline Animator

Sunday, October 19, 2008

How to load Web UserControl at runtime.

For adding Web User control programatically at runtime in ASP.NET write below lines of code.

Control ctl = (Control)Page.LoadControl("~/Controls/MyUserControl.ascx");
[add to form]
Page.Form.Controls.Add(ctl);

[ or add to panel]

Panel1.Controls.Add(ctl);

Submit this story to DotNetKicks

No comments:

Post a Comment

Post your comments/questions/feedback for this Article.

 

Latest Articles