Loading User Controls Dynamically at Run time

liptonIcedTea

Well-known member
Joined
Jan 18, 2007
Messages
89
Programming Experience
1-3
Hi,

I've been stuck on this for a few hours and it's starting to annoy me.

Is it possible to load custom User Controls dynamically at run time with the code behind page?

I have a placeholder which I want to use to load up several (.ascx) User controls dynamically. However, I have no idea how to do it.

It's not even recognising the user controls when I type it in

eg. dim UserControl1 = new UserControl1 <== gives me an error

Yet, I seem to be able to just drag it onto my aspx page. I've got these ascx pages registered... What am I doing wrong? Why isn't it recognizing these user control files?
 
Back
Top