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.

0

1 Answer 1

2

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

Sign up to request clarification or add additional context in comments.

3 Comments

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.
My advice would be to use a Web Application Project instead.
I strongly second that advice. Website projects are meant to be easy for non-coders, but you lose the control that coders demand.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.