开发者

how to access a namespace inside app code folder from another folder

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 a开发者_如何学JAVApplication 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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜