Hello,
I need to know how to access the user controls dynamically.
There is a drop down list with the name of the forms. If the user selects a form and hits submit some user controls should be displayed based on the selected form.
There is a table which contains the Form Name. name of user control and the order in which they should appear. Based on this table can i call the user controls and place them in the screen. Please let know how this can be done?
Thanks
Sowmya
Calling a user control dynamically.
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Dipen LamaRank #3,323 · 432 reputationPosted Jul 17, 2006, 8:34 PM EDT
Here is some lines:
string userControlName = "UserControl1.ascx";
Control control1 ;
control1 = LoadControl( userControlName );
placeHolderControl1.Controls.Clear();
placeHolderControl1.Controls.Add( control1 );