how to add user controls

  • Thread starter Thread starter Ufit
  • Start date Start date
U

Ufit

Asume I have panel on a webform and I created few user controls (.ascx)
How do I programaticaly add my user controls to that panel so it displays them
as some sort of controls list? I've tried instantiating class and adding by
panel.Controls.Add(mycontrol) but it doesnt work and nothing comes up.
Thanks for help.

Uf
 
Asume I have panel on a webform and I created few user controls (.ascx)
How do I programaticaly add my user controls to that panel so it displays them
as some sort of controls list? I've tried instantiating class and adding by
panel.Controls.Add(mycontrol) but it doesnt work and nothing comes up.
Thanks for help.

Uf

take a look at Page.LoadControl

I think that is what you want.
Peter Kellner
http://peterkellner.net
 
Back
Top