Jan 12 2006

Add NameSpaces in Web.Config

Category: ASP.NET 2.0 - GeneralBil@l @ 05:38

A new and cool feature in ASP.NET 2.0, that allows you to import default namespaces once in the Web.Config file, and then every ASPX page (Not Code-Behind) can see those imported namspaces. Here is a small code:

<?xml version="1.0"?>
<configuration>
 <system.web>
    <pages buffer="true" maintainScrollPositionOnPostBack="true">
      <namespaces>
        <add namespace ="System.Web" />
        <add namespace="System.Text"/>
      </namespaces>
    </pages>  
 </system.web>
</configuration>

Hope you liked that.

Regards

Tags:

Comments are closed