开发者

add default namespaces

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜