load dynamically UserControl

S

Stan SR

Hi,

With asp.net 2, c# I try to load UserControl on "fly".
When I test the website using VS2005, everything works.
When I try to publish the website, I get some errors like :
"The type or namespace "controles_myUserControl" could not be found (are you
missing a using directive or an assembly reference"

And here's how I code my page :

if (isfind){
controles_myUserControl ctrl=
(controles_myUserControl)Page.LoadControl("controles/myUserControl.ascx");
}else{
controles_myUserControlb ctrl=
(controles_myUserControlb)Page.LoadControl("controles/myUserControlb.ascx");
}

How can I fix this problem ?

Thanks

Stan
 
B

bruce barker \(sqlwork.com\)

you need to add a reference (@Reference) to the user control on the page
otherwise you are counting on batch compile to include it in the same
assembly.

-- bruce (sqlwork.com)
 

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,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top