A, Web.Config XML file specification is stored, the configuration file is divided into the following format
1. Configuration section handler declaration Features: Located in the top of the configuration file, included in the <configSections> logo.
2. A specific application configuration features: in <appSetting> in. You can define a global constant set application and other information.
3. Configuration section set features: in <system.Web> section, the control Asp.net runtime behavior.
4. Configuration section group characteristics: with <sectionGroup> tags, you can customize the grouping, you can put inside, or other <sectionGroup> <configSections> tag inside.
Second, the configuration section of each section
1. <configuration> Section of the root element, the other section is in its interior.
2. <connectionStrings> Festival
<Add name = "SqlDBConnStr"
connectionString = "Data Source = (local); Initial Catalog = test; User"
providerName = "System.Data.SqlClient" />
3. <appSetting> Section This section is used to define application settings items. For some uncertain settings, also lets users set up their own according to their actual usage:
<add key="Conntction" value="server=192.168.85.66;userid=sa;password=;database=Info;"/>
Defines a connection string constant, and in the actual application can modify the connection string, without changing the program code.
<add key="ErrPage" value="Error.aspx"/>
Define an error redirect page.
4. <compilation> Festival Format:
defaultLanguage = "c #"
debug = "true"
(1). Default language: the language code defined in the background, you can choose two languages C # and VB.net.
(2). Debug: true, start the aspx debugging; to false does not start aspx debugging, which can improve the application to run
Time performance. Generally set at development time programmers true, to the client when set to false.
5. <customErrors> Festival Format:
mode = "RemoteOnly"
defaultRedirect = "error.aspx"
<error statusCode="440" redirect="err440page.aspx"/>
<error statusCode="500" redirect="err500Page.aspx"/>
(1). Mode: with On, Off, RemoteOnly 3 different states. On that always display custom information; Off asp.net that always show the detailed error information; RemoteOnly that not only the local Web server running on the user display custom information.
(2). DefaultRedirect: error when used to redirect URL. Is optional
(3). StatusCode: specified error status code, indicating that a particular error condition.
(4). Redirect: wrong redirection URL.
6. <globalization> Festival
requestEncoding = "utf-8"
responseEncoding = "utf-8"
fileEncoding = "utf-8"
I.requestEncoding: It is used to examine every request made to the code.
II.responseEncoding: used to check the contents of the response sent back to the code.
III.fileEncoding: used to check the aspx, asax resolution and other documents the default encoding.
7. <sessionState> Festival
mode = "InProc"
stateConnectionString = "tcpip = 127.0.0.1:42424"
sqlConnectionString = "data source = 127.0.0.1; Trusted_Connection = yes"
cookieless = "false"
timeout = "20"
(1). Mode: divided off, Inproc, StateServer, SqlServer several states
Here are details of this property: http://blog.csdn.net/chengking/archive/2005/10/27/518079.aspx
(2). StateConnectionString: Asp.net application specified a remote session state store the server name, default-based machine
(3). SqlConnectionString: When using session state database, set the connection string here
(4). Cookieless: set to true, that does not use session state cookie to identify the customer; otherwise, on the contrary.
(5). TimeOut: session state storage is used to define the time the deadline, will automatically terminate the session.
7. <authentication> Festival Format:
<forms name=".ASPXUSERDEMO" loginUrl="Login.aspx" protection="All" timeout="30"/>
(1). Windows: use the IIS authentication
(2). Forms: Forms-based authentication
(3). Passport: Passport cookie authentication mode used
(4). None: do not use any authentication properties of the nodes inside the embedded meaning of Forms:
(1). Name: Specifies the complete authentication Http cookie name.
(2). LoginUrl: If you do not pass validation or time-out after the redirect page URL, usually the login page, allowing users to log in again
(3). Protection: Specifies the cookie data protection.
Can be set to: All None Encryption Validation four protection method
a. All that encrypt data and verify the validity of two ways
b. None said they did not protect the Cookie.
c. Encryption that encrypts the content of the Cookie
d. validation that the content of Cookie Validation
(4). TimeOut: Specifies the Cookie's expiration time. Time out to re-login.
This article comes from CSDN blog, reproduced, please credit: http://blog.csdn.net/21aspnet/archive/2007/03/20/1535585.aspx