Click to Rate and Give Feedback
MSDN
MSDN Library
Visual Studio 2008
Visual Studio
 Configuring Specific Files and Subd...

  Switch on low bandwidth view
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
ASP.NET Configuration
Configuring Specific Files and Subdirectories

Configuration settings can be applied to specific resources by using a <location> tag with an appropriate path attribute. The path attribute can be used to identify a specific file or child directory to which unique configuration settings apply. Only one file path can be used in the path attribute. The path attribute can start with the "~/" shortcut which indicates the application root. For more information, see ASP.NET Web Site Paths.

For example, the following example configuration file specifies settings at three levels:

  • Settings that apply to the current directory and all child directories (everything contained within the top <configuration> tag).

  • Settings that apply to the Sub1 child directory (everything contained within the <location> tag with a path attribute set to Sub1).

  • Settings that apply to the Sub2 child directory (everything contained within the <location> tag with a path attribute set to Sub2).

<configuration>
  <system.web>
    <sessionState cookieless="true" timeout="10"/>
  </system.web>
         
  <!-- Configuration for the "sub1" subdirectory. -->
  <location path="sub1">
    <system.web>
      <httpHandlers>
        <add verb="*" path="sub1" type="Type1"/>
        <add verb="*" path="sub1" type="Type2"/>
      </httpHandlers>
    </system.web>
  </location>
   
  <!-- Configuration for the "sub1/sub2" subdirectory. -->
  <location path="sub1/sub2">
    <system.web>
      <httpHandlers>
        <add verb="*" path="sub1/sub2" type="Type3"/>
        <add verb="*" path="sub1/sub2" type="Type4"/>
      </httpHandlers>
    </system.web>
  </location>
</configuration>

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker