How to Load User Controls dynamically?

 Posted by vishalneeraj-24503 on 12/21/2013 | Category: ASP.NET Interview questions | Views: 1137 | Points: 40

With the hrlp of LoadControl of Page class,we can dynamically Load any User Controls:-

For Example:-
protected void Page_Load(object sender, EventArgs e)

Control myCtrl = null;
myCtrl = Page.LoadControl("~/UserControls/UcTeamControl.ascx");


Where,UcTeamControl.ascx is my User Control.

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response