Detailed description of the web. config file

Source: Internet
Author: User
Tags error status code http cookie
(1). Web. config is stored in XML format. configuration files are classified into the following formats:
1. Configuration section processing Program Statement
Feature: located at the top of the configuration file, included in Flag.
2. Specific Application configuration
Feature: Located in the middle. You can define global constant settings and other information of an application.
3. Configuration section settings
Features: Control the Asp.net runtime behavior.
4. Configure the section group
Features: Use
Tag, which can be customized and placed in Internal or other
Inside the tag.
(2). Configuration section
1. Section
Root element, and other sections are inside it.
2. Section
This section defines application settings. You can also set some uncertain settings based on your actual situation.
Usage:
I.



Defines a connection string constant, and can modify the connection string in the actual application, without modifying the program Code .
II.


Defines an error redirect page.
3. Section
Format:
Defaultlanguage = "C #"
DEBUG = "true"
/>
I. default language: defines the background code language. You can select C # And VB.net.
When iidebug is set to true, aspx debugging is started; if it is set to false, aspx debugging is not started, so the application program can be improved.
Performance. Generally, programmers are set to true during development and false when handed over to customers.
4. Section
Format:
Mode = "remoteonly"
Defaultredirect = "error. aspx"


/>
I. Mode: it has three states: On, off, And remoteonly. On indicates that custom information is always displayed; Off indicates that detailed Asp.net error information is always displayed; remoteonly indicates that custom information is only displayed for users not running on the Local Web server.
Ii. defaultredirect: the URL used for redirection when an error occurs. Optional.
Iii. statuscode: indicates the error status code, indicating a specific error status.
Iv. Redirect: the URL of the error redirection.
5. Section
Format:
Requestencoding = "UTF-8"
Responseencoding = "UTF-8"
Fileencoding = "UTF-8"
/>
I. requestencoding: used to check the encoding of each request.
Ii. responseencoding: used to check the encoding of the returned response content.
Iii. fileencoding: used to check the default encoding for parsing files such as aspx and asax.
6. Section
Format:
Mode = "inproc"
Stateconnectionstring = "TCPIP = 127.0.0.1: 42424"
Sqlconnectionstring = "Data Source = 127.0.0.1; trusted_connection = yes"
Cookieless = "false"
Timeout = "20"
/>
I. Mode: status options include off, inproc, StateServer, and sqlserver.
This property is detailed here: http://blog.csdn.net/chengking/archive/2005/10/27/518079.aspx
Ii. stateconnectionstring: Specifies the name of the server in which the Asp.net application stores the remote session status. The default value is local.
Iii. sqlconnectionstring: When a database in session status is used, set the connection string here.
Iv. cookieless: if it is set to true, the cookie session status is not used to identify the customer. Otherwise, the opposite is true.
V. Timeout: used to define the time for storing session status. If the duration is exceeded, the session is automatically terminated.
7. Section
Format:






I. Windows: using IIS Authentication
Ii. Forms: use form-based authentication
Iii. Passport: Passport cookie Authentication Mode
Iv. None: no verification method is used.
Meaning of the attributes of embedded forms nodes:
I. Name: Specifies the name of the HTTP cookie that completes authentication.
Ii. loginurl
Iii. Protection: Specifies the cookie data protection method.
It can be set to: All none encryption validation.
A. All indicates data encryption and verification of validity.
B. None indicates that the cookie is not protected.
C. Encryption indicates encryption of cookie content
D. Validation indicates that the cookie content is validated.
Iv. Timeout: Specifies the cookie expiration time. After timeout, you must log on again.

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.