开发者

add default namespaces

开发者 https://www.devze.com 2023-02-17 14:14 出处:网络
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 becaus

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.

0

精彩评论

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