asp+ Configuration-asp+ Configuration concept (ii)

Source: Internet
Author: User
Tags config configuration settings contains
asp+| concept config.web configuration file
All asp+ configuration information is included in the configuration file named Config.web. The following example illustrates the structure of a asp+ configuration file:
Code:
<!--CONFIG. WEB FILE-->
<configuration>
<configsections>
<add names= "httpmodules" type= "System.Web.Config.HttpModulesConfigHandler"/>
<add names= "httphandlers" type= "System.Web.Config.HttpHandlerConfigHandler"/>
<add names= "sessionstate" type= "System.Web.Config.SessionStateConfigHandler"/>
<add names= "Globalization" type= "System.Web.Config.GlobalizationConfigHandler"/>
<!--ADDITIONAL configsection DECLARATIONS Go-->
</configsections>
<!--http Module subelements go-->
<!--http handlers subelements go-->
<sessionstate>
<!--session state subelements Go-->
</sessionstate>
<globalization>
<!--session state subelements Go-->
</globalization>
<!--ADDITIONAL CONFIG SECTIONS Go-->
</configuration>

All configuration information must reside between the <configuration> and </configuration> tags. The configuration file has two main sections. At the top are the handler declarations for the configuration section (included in the <configsection> and </configsection> tags). The remainder of the file includes the actual configuration section (in order to be clear, their child elements have been removed). Note that each of the following configuration subsections must exist for a declaration that should have a <configsection>. Each declaration gives the configuration section name and indicates the NGWS Framework assembly and class that will process its configuration information. Each configuration section contains child elements that contain asp+ detail configuration settings.
The following code illustrates these concepts:
Code:
<configuration>
<configsections>
<add name= "DebugMode" type= "System.Web.Config.SingleTagSectionHandler"/>
<add name= "Globalization" type= "System.Web.Config.SingleTagSectionHandler"/>
<add name= "Assemblies" type= "System.Web.UI.AssembliesSectionHandler"/>
<add name= "Security" type= "System.Web.Config.SecurityConfigHandler"/>
</configsections>
<debugmode enable= "true"/>
<globalization
Requestencoding= "Us-ascii"
Responseencoding= "Iso-8859-1"
/>
<assemblies>
<add assembly= "System.Data.dll"/>
<add assembly= "System.dll"/>
<add assembly= "System.Drawing.dll"/>
<add assembly= "*"/>
</assemblies>
<security>
<authorization>
<allow users= "*"/> <!--allow all users-->
</authorization>
</security>

</configuration>

This example illustrates a configuration file that contains four configuration sections--debugmode,globalization,assemblies and security. The following are the settings that have been established:
* In the Debug section, Debug mode is turned on (set to true).
* In the globalization section, the encoding of the request and response (Response) is set.
* In the Assemblies section, four Assemblie were added.
* In the Security section, all users are given access rights.

Related Article

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.