简体   繁体   中英

default namespace for an ASP.NET project in vs2008

I am working on a asp.net web app in visual studio team system 2008 (visual web developer 2008) (version 9.0.21022.8) (.NET 3.5 sp1). I'm trying to figure out how to add a "default" namespace to this project.

I don't see any where in the properties that even references namespaces. I know in VS 2010 there is a properties dialog box, but I can't find it in VS 2008.

I've been Googling all day and can't find anything relating to this. What I have run across there appears to be this option, but no directions how to get to that screen.

Most likely you are working on a Web Site project rather than a Web Application project.

Web sites do not have a default namespace (as other .Net projects have), and the page classes are in the global namespace. Code-behind files do not contain a namespace declaration, and markup references the classes without a namespace.

Right click on the project in solution explorer. Open up properties. Then under the application tab you should see a Default Namespace field in which you can enter your default namespace.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM