Search code examples
asp.netaspnet-compiler

ASP.NET Compilation And Code Visibility


How ASP.NET compiles its assemblies generally confuses me. It seems that I cannot program against anything outside the App_Code folder. In the application I am working on I have several server side controls and a few user controls. The user controls are outside the App_Code folder and I cannot refer to them from the App_Code folder. It is a "Web Site" project.

How can I refer to the UserControls from the App_Code directory? Is this a compilation issue?

Thanks in advance.


Solution

  • Yes, it is a compilation issue, read a bit more about this same question at

    http://www.velocityreviews.com/forums/t119801-accessing-web-user-control-from-class-in-appcode-folder.html

    Whilst I'm sure suggesting you convert the web site to a web application is something you have considered doing and rejected, it may be the way forward if accessing your user controls is something you're looking to do frequently.