Detailed web.config file

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 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" />
</ ConnectionStrings>

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=;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.
(2). <appSettings>
<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
(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 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 ="
sqlConnectionString = "data source =; Trusted_Connection = yes"
cookieless = "false"
timeout = "20"
(1). Mode: divided off, Inproc, StateServer, SqlServer several states
Here are details of this property:
(2). StateConnectionString: 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:
<authentication mode="Forms">
<forms name=".ASPXUSERDEMO" loginUrl="Login.aspx" protection="All" timeout="30"/>
</ Authentication>
<deny users="?"/>
</ Authorization>
(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:

分类:DotNet 时间:2010-10-21 人气:485
blog comments powered by Disqus


  • Data Source Xiangjie 2010-04-15

    First, the data source Description: ************************************************** ********************************** In the Java language, DataSource object is a representative of the data source entity objects. A data source is a tool used to s

  • Configure Spring Data Source 2010-04-04

    No matter what kind of lasting through technology, we must access the database through the data connection, in the Spring, the data connection is obtained through the data source. In the past, applications, the data source is usually provided by the

  • Configure a data source, spring 2010-03-26

    Configure a data source Spring in the third-party dependency package contains two data source implementation class package, One is Apache's DBCP, second, C3P0. In the Spring configuration file can take advantage of this configuration of either a data

  • JDBC data source (DataSource) of the simple implementation 2010-06-21

    Java data source to operate the database technology is a key technology, the popular persistence frameworks can not do without the application of the data source. Data source provides a simple way to obtain a database connection, and can pool in the

  • WebSphere6.1 DB2 data source configuration under 2011-08-03

    Turn: WebSphere6.1 DB2 data source configuration under 2010-04-09 15:40:46 | Category: Knowledge Base - base class | Font Size Subscribe First, configure the DB2 database, open the DB

  • In the 64-bit server 2003 to add the Excel Odbc data source solution 2011-06-10

    In the past two days on the 64-bit server 2003 deployment projects, since the project used the odbc excel export, so the need to add the Excel data source odbc driver. As the project's development environment is using 32-bit XP system, the generated

  • Creating a MySQL data source using WebSphere Application Server 2010-03-29

    DATABASE CONNECTIVITY Recently, Senior Technical Editor Dan Velasco wrote an article on how to connect to the popular open source database MySQL from WebSphere Studio Application Developer (see

  • The data source connection pool grounds 2008-06-30

    In recent years, with the Internet / Intranet networking technology and the rapid development and the rapid worldwide spread of computer applications from the traditional desktop applications to Web applications. Based on B / S (Browser / Server) arc

  • IV. Tomcat5 to configure the connection pool and data source 2010-10-06

    1, DataSource interface, introduced (1) DataSource Overview JDBC1.0 they are used DriverManager class to create a data source. JDBC2.0 use an alternative approach, using the DataSource implementation, the code becomes more compact, more easily contro

  • Get a database connection (in the normal way and the way the data source) 2010-12-15

    Step One: Create a JavaWeb works, called DBConnPrjTest (this project name is variable) Step Two: In DBConnPrjTest \ WebRoot \ WEB-INF \ lib, add the following package and loaded into the project: commons-logging-1.1.1.jar ojdbc14.jar: oracle database

iOS 开发

Android 开发

Python 开发



PHP 开发

Ruby 开发






Javascript 开发

.NET 开发



Copyright (C), All Rights Reserved. 版权所有 闽ICP备15018612号

processed in 0.053 (s). 13 q(s)