Answered by:
How to access class files not in App_Code folder

Question
-
User1281245994 posted
Hi,
I have a single project. and I have two folder in it. In the 1st folder I have a class named Class1 and in the 2nd folder I have a class named Class2. Can anyone tell me how I can access members of Class1 in Class2. I have tried by adding namespace in Class1 and Using that namespace in Class2. But it is giving error.
It is easy to access classes or their members from App_Code folder. I don't want to put my classes in app_code folder.
Thanks in AdvanceThursday, February 25, 2010 6:33 AM
Answers
-
User48953143 posted
Hi,
app_code is used for this purpose that all your .cs and .vb clases in this folder.you further add subfolders in app_code to manage your code prperly.
app_code compile and convert into a dll and all other code access it easily.
inother case,
for this case You must add a class library project and reference this in your website.but this can be done if u use Layer Architecture(# Layer or 4 Layer).Hope u get it.
you must read the following article
http://msdn.microsoft.com/en-us/library/ex526337.aspx
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Thursday, February 25, 2010 1:23 PM
All replies
-
User197322208 posted
put in a separate dll and reference this dll from the web project
Thursday, February 25, 2010 9:27 AM -
User48953143 posted
Hi,
app_code is used for this purpose that all your .cs and .vb clases in this folder.you further add subfolders in app_code to manage your code prperly.
app_code compile and convert into a dll and all other code access it easily.
inother case,
for this case You must add a class library project and reference this in your website.but this can be done if u use Layer Architecture(# Layer or 4 Layer).Hope u get it.
you must read the following article
http://msdn.microsoft.com/en-us/library/ex526337.aspx
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Thursday, February 25, 2010 1:23 PM -
User48953143 posted
Hi,
app_code is used for this purpose that all your .cs and .vb clases in this folder.you further add subfolders in app_code to manage your code prperly.
app_code compile and convert into a dll and all other code access it easily.
inother case,
for this case You must add a class library project and reference this in your website.but this can be done if u use Layer Architecture(3 Layer or 4 Layer).Hope u get it.
you must read the following article
http://msdn.microsoft.com/en-us/library/ex526337.aspx
Thursday, February 25, 2010 1:25 PM