Not able to load web user control dynamically in ASP .Net 2.0

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am not able to load and attach a web user control to a placeholder
dynamically in 2.0 beta.

Do I miss something?

Thanks
 
Atul said:
I am not able to load and attach a web user control to a placeholder
dynamically in 2.0 beta.

Do I miss something?

Thanks
toload your UC
instead of
myUc = new myUc();
placehloader.control.add(myUc);

do
myUC = LoadControl("pathToUserWebControl");
placehloader.control.add(myUc);
 
I have tried this but does not work.

Somehow the control will not show up. on the page. I also tried to add to
page but something is missing.
 
Thanks Allen,

Here is my code, it is exactly identical so if you say that it works then
pretty sure something is wrong at my end.

Page.LoadControl(pathtocontrol)
Placeholder.Controls.Add(abovecontrol);

Atul
 

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

Back
Top