Asp. NET request pipeline, Application life cycle, overall operating mechanism

Source: Internet
Author: User

We know that in ASP. To initialize an ASP. NET application and make it handle requests, you must perform some processing steps to familiarize yourself with the application lifecycle so that you can write code at the appropriate lifecycle stage to achieve the desired results. Never do anything that will only drag the control. NET programmer, never! Then you have to understand the ASP. NET application lifecycle, understand the ASP. NET page life cycle, and understand the principles of ASP. Next, let's take a look at

You can first look at the pilot chapter "deep into the ASP series"--asp. Net request pipeline for the common parts of ASP. WebForm and ASP.

This article will focus on the ASP. NET request pipeline in the ASP. Many of us may already know that the ASP. NET request pipeline has 19 events, which is the case when IIS 5.0 and IIS 6.0 or IIS 7.0 or more Classic mode is running. When an application runs in Integrated mode in IIS 7.0 and runs with the. NET Framework 3.0 or later, ASP. NET request pipeline is a 22 event.

When you are programming for facets, you are given the means to add your own processing logic to the predetermined order of execution. in ASP-oriented programming, we can inject our own code into the ASP. NET request pipeline. In general, there are two ways to directly add code directly to the corresponding method in Global.asax. One is to extend the ASP. NET application life cycle by using a module that implements the IHttpModule interface. Managed code modules can also be registered in the modules element of the IIS 7.0 configuration store (applicationhost.config file). Modules registered in the ApplicationHost.config file have global scope because they are registered for all WEB applications that are hosted by IIS 7.0. Similarly, the native code module defined in the Globalmodules element of the ApplicationHost.config file also has a global scope. If the WEB application does not require a global module, you can disable it.

Let's take a look at a picture, (always think that the graph is easier to understand than the text) specifically, see what the pipeline events in the ASP. if the figure is not clear, you can download the picture view. (Because the picture is self-drawn, if there is wrong, welcome to point out the criticism of communication, the figure of the 22 events show Code at the end of the article attached)

output The global code for 22 events: Http://files.cnblogs.com/files/zhangyihui/Global.rar

Asp. NET request pipeline, Application life cycle, overall operating mechanism

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.