Posts

Showing posts from 2017

Class files in App_Code folder cannot be accessed from other pages in Web application project

Image
                                                I have faced this problem multiple times and each time i found some solutions from Internet and go on with it. So I thought this time I will post it on the blog so next time I don't have to look somewhere else. Also it will be helpful for others.                We usually hear that class file in the project must put in App_Code folder. Actually this will work with Website projects in ASP.NET. In case of Web application project When we compile the Web application project, it won't include all file. This is the reason we can't access the class files in App_Code folder from other pages (because this file are not compiled). So to import a class file from App_Code folder in a WAP, we need to taken properties of class file in App_Code folder. Properties window will open as shown in image below.                  In properties window "Build Action" is set to "Content" as default. Change this option