Is it possible to somehow add default namespaces to each code file that I am editing in 开发者_高级运维Visual Studio 2010 web site project? I am tired of specifying them each time I edit a page because they are pretty much the same on each page.
You can add namespaces in web.config
, in the <pages>
section in order to not have to include them in every page.
You add them like this:
<pages>
<namespaces>
<add namespace="System.Web.UI"/>
</namespaces>
</pages>
There are no namespaces in Web site projects. If you want that, you have to use the Web Project template.
精彩评论