Understand ASP. NET Web Application Models

Source: Internet
Author: User

Some asp.net programmers say: What is the Web. config file? I have never heard of it, but can the program I wrote work properly? Yes, you are right. Without the Web. config file program, it can run normally. However, if you create a large website, you need to make some overall configuration for the entire website, for example, you need to use the Web. config file. Although some options in the Web. config file can be configured through IIS, if the corresponding settings in Web. config also overwrite the configuration in IIS. In addition, the biggest convenience of the Web. config file is that you can access the settings in web. config by calling the System. Web namespace on the asp.net page.

There are two types of ASP. NET Web. config: the server configuration file and the Web application configuration file, both named Web. config. This configuration file stores a series of information about the web pages written in which language, Application Security Authentication mode, and Session information storage mode on the current IIS server. This information is saved using XML syntax. If you want to edit it, use the text editor.

The server configuration file takes effect for all applications on all sites on the IIS server. In. NET Framework 1.0, the Web. config file of the server exists in \ WinNT \ Microsoft. NET \ Framework \ v1.0.3705.

The ASP. NET Web application configuration file Web. config is stored in various Web applications. For example, the root directory \ Inetpub \ wwwroot of the current website, and the current Web application is MyApplication, the root directory of the Web application should be \ Inetpub \ wwwroot \ MyApplication. If your website has only one Web application, the root directory of the application is \ Inetpub \ wwwroot. To add a Web application, add a virtual directory with the application starting point in IIS. The files and directories under this directory are considered as a Web application. However, adding a Web application through IIS does not generate a Web. config file for you. To create a Web application with a Web. config file, use Visual Studio. NET to create a Web application project.

The configuration file Web. config of ASP. NET Web applications is optional and optional. If not, each Web application uses the Web. config configuration file of the server. If yes, the corresponding values in the Web. config configuration file of the server will be overwritten.

In asp.net, modifications to Web. config will automatically take effect immediately after they are saved. You do not need to restart the Web application to take effect after modifying the configuration file in ASP.

  1. Brief Introduction to ASP. NET Session Model
  2. ASP. NET page lifecycle: stages, events, and others
  3. Introduction to ASP. net mvc Lifecycle
  4. Several methods for processing ASP. NET Session invalidation
  5. ASP. NET: all instances share a static variable.

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.