tags:

views:

46

answers:

1

I have a class file stored in the app code folder. A certain page that I want to access is inside its own folder within the root and it is using the namespace within the class file in the app code folder. How do I tell the application where the file is?

I'm sure I could put the code in a file inside my folder, but I'd rather not have duplicate code in two different files... unless there is a way to make a reference of some type. Please advise.

+2  A: 

This is a problem when using ASP.NET website project templates. There is no namespace as far as I know in website projects. I'm not that familiar with them because I always use Web Application Project templates. If you're going this route, try putting all your class files in the App_Code folder, or alternatively create a separate library project and reference that.

Here is some info on migration to WAP if you decide to do that (best if project not too big):

http://webproject.scottgu.com/CSharp/Migration2/Migration2.aspx

You might be able to tweak the order of compilation:

http://msdn.microsoft.com/en-us/library/54dwfbb7.aspx

IrishChieftain
my class file is inside the app_code folder. I have a webform inside a folder and it can't see the app_code folder for some reason.
nick
My advice would be to use a Web Application Project instead.
IrishChieftain
I strongly second that advice. Website projects are meant to be easy for non-coders, but you lose the control that coders demand.
Steven Sudit