Geeks With Blogs
AzamSharp Some day I will know everything. I hope that day never comes.

I was trying to place a UserControl inside the App_Code folder. The main reason for putting the UserControl inside App_Code folder was to make it as a BaseUserControl so that other UserControls are able to inherit from it. Whenever I tried to add a UserControl in the folder it throws the exception saying that UserControls are not permitted in the App_Code folder. This is little strange since I have a webform which is also inside the App_Code folder. The webform (Page) serves as the BasePage for other ASP.NET pages.

powered by IMHO 1.3

Posted on Thursday, March 2, 2006 3:43 PM | Back to top


Comments on this post: Why can't I place UserControls inside the App_Code Folder

# re: Why can't I place UserControls inside the App_Code Folder
Requesting Gravatar...
I had the same problem with mine and found that I had to unlink the code behind from the ascx by removing the CodeFile attribute from the <%@ control %> statement. Then you also need to add all of the controls in your ascx to your code behind as protected variables like you had to in .NET 1.1.

I'm still looking into why this is happening. I'm going to write it up on my blog (http://webdev.helephant.com) when I find out more information.
Left by Helen Emerson on Apr 06, 2006 5:31 AM

# re: Why can't I place UserControls inside the App_Code Folder
Requesting Gravatar...
plz give me the solution of this question
Left by tanvi suji on Feb 28, 2007 5:37 AM

Your comment:
 (will show your gravatar)


Copyright © Mohammad Azam | Powered by: GeeksWithBlogs.net