mayur Rathod
mayur Rathod

Reputation: 1404

Add new namespace to all newly created pages in asp.net with c#

I have required System.Text.RegularExpressions namespace to all my pages on my webproject.so want to add this namespace by default when new page is created on my project.so what i do for this.

Upvotes: 0

Views: 1040

Answers (2)

simon831
simon831

Reputation: 5476

You can add it to the web.config, and then it will not need to be specified on any page. http://msdn.microsoft.com/en-us/library/ms164642.aspx

<configuration>
 <system.web>
    <pages>
      <namespaces>
        <add namespace ="System.Text.RegularExpressions" />
      </namespaces>
    </pages>  
 </system.web>
</configuration>

Upvotes: 4

BALKANGraph
BALKANGraph

Reputation: 2051

You can create custom project item templates and have this template appear in the Add New Item dialog box.

For more details see How to: Create Item Templates

Upvotes: 0

Related Questions