Specifies the resource that requires specific configuration settings.
Configuration Structure example:
<Configuration>
<Location>
<Location Path= "Path"AllowOverride = "True | false"/>
Optional attributes
Attribute |
Option |
Description |
Path |
|
Resources that require specific configuration settings. If you use<Location>If no path attribute is specified, the configuration settings are applied to the current directory and all subdirectories. If you use<Location>Not SpecifiedPathAttribute, andAllowOverrideSpecified False The Web. config file in the subdirectory cannot change the configuration settings. |
AllowOverride |
|
Specify whether the configuration settings can be overwritten by the web. config file in the subdirectory. |
|
True |
Overwrite configuration settings. The default value is True . |
|
False |
Specifies that the configuration cannot be overwritten. |
Example
In the following example, Anonymous Users are allowed to access the logon. ASPX page.
<Configuration> <Location Path = "Logon. aspx"> <system. Web> <authorization> <allow users = "? "/> </Authorization> </system. Web> </location> </configuration>
In the following example, only the size limit of the uploaded files on the specified page is set to kb.
<Configuration> <Location Path = "uploadpage. aspx">
In the following example, you cannot change the configuration settings in the web. config file in the subdirectory.
<Configuration> <location AllowOverride = "false"/> </configuration>