how to add user controls

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
 
P

PeterKellner

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,118
Latest member
LatishaWhy
Top