Applying Configuration Settings to a Particular Path : Introduction « Configuration « ASP.NET Tutorial






By default, the settings in a Machine.config or Web.config file are applied to all pages in the same folder and below. 
You can apply configuration settings to a particular path. 

You apply configuration settings to a particular path by using the <location> element. 
For example, the following web configuration file enables password-protection for a single file named Secret.aspx.
The <location> element must be added as an immediate child of the <configuration> element. 

File: Web.config

<configuration >

  <system.web>
    <authentication mode="Forms" />
  </system.web>

  <location path="Secret.aspx">
    <system.web>
      <authorization>
        <deny users="?" />
      </authorization>
    </system.web>
  </location>

</configuration>








16.1.Introduction
16.1.1.Overview of Website Configuration
16.1.2.Applying Configuration Settings to a Particular Path
16.1.3.The web.config File
16.1.4.Using Elements
16.1.5.Locking Configuration Settings
16.1.6.Lock the debug attribute, and only the debug attribute, of the element.
16.1.7.Adding Custom Application Settings
16.1.8.Placing Configuration Settings in an External File
16.1.9.Opening a Configuration File on a Remote Server