views:

24

answers:

1

I have a user control which is being added to a page dynamically. It works fine on my computer whether a site is running on an integrated Visual Studio server or deployed to IIS.
But when the site is deployed to a production server, I see the contents of a user control's code-behind file instead of a control.
Have you any ideas what can cause this?
Thank you.

EDIT: The site is running on IIS 6 and here is the code I am using to add the control to a page

`this.Controls.Clear();
 this.Controls.Add(LoadControl("MyUserControl.ascx"));`
A: 

Yikes. That should never happen. Are other ASP.NET pages working correctly? Are you sure ASP.NET is properly registered on the server? I think you'll need to give us some more information... what version of IIS are you running, and post the code where you dynamically add the user control.

Bryan