Elements in the web. config configuration file

Source: Internet
Author: User

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>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.