Friday, May 6, 2011

How load a user control at run time

1) Add the content place holder on the web page.
2)put the following code at required place.



 Control MyUserControl = (Control)this.Page.LoadControl("UserControls/LoadUCatRunTime.ascx");
             lit.Controls.Add(MyUserControl);

No comments:

Post a Comment