ASP. NET Application Life Cycle for IIS 5.0 and 6.0

Source: Internet
Author: User

The application lifecycle has the following phases:

1. the user initiates an application source from the web server:

Description: The asp.net application originated from a browser that initiates a request to the web server (usually IIS). asp.net is an extension of the ISAPI under the web server. When the web server receives a request, it checks the request file name suffix to determine which ISAPI extension program is used to process the request, and then sends the request to the appropriate ISAPI extension program based on the asp.net handle file name suffix, for example, aspx, ascx, ashx, and asmx

2. The asp.net Server accepts the first request:

Description: When the asp.net server receives the first request for any file, applicationManager creates an application domain. application domain provides application and global variable contact and allows each application to be detached independently. In an application domain,

An instance named hostingEnvironment that provides application such as application storage information is created.

3. asp.net creates a core object for each request:

Description: After the application domain and hostingEnvironment classes are instantiated, asp.net creates httpcontext, httprequest,

Httpresponse core object. The httprequest core object contains the current request information, including Cookies and browser information. The httpresponse core object returns information containing all the rendering and cookies to the client.

4. An httpapplication is assigned to a request:

Description: After initializing all core objects, the application starts to create an httpapplication instance. If this httpapplication has a global. in the asax file, asp.net instead creates global from httpapplication. the asax class instance uses this instance to represent httpapplication.

5. The request is processed by the httpapplication pipeline:

Description: The request is executed through the httpapplication class.

. Verify the request, check the information sent through the browser, and decide whether it contains potential malicious files.

5.2. perform URL reflection if any URLS has been configured in the UrlMappingsSection of the web. config file.

5.3. Execute the BeginRequest event.

5.4. Execute the AuthenticateRequest event.

5.5. Execute the PostAuthenticateRequest event.

5.6. Execute the AuthorizeRequest event.

5.7. Execute the PostAuthorizeRequest event.

5.8. Execute the ResolveRequestCache event.

5.9. Execute the PostResolveRequestCache event.

5.10 Based on the suffix of the request source file (in the application configuration file), select a class that calls IHttpHandler to process the request. If you request a page class or inherit the page class, you must compile the page class when creating an instance.

5.11 execute the PostMapRequestHandler event.

5.12 execute the AcquireRequestState event.

5.13 execute the PostAcquireRequestState event.

5.14 run the PreRequestHandlerExecute event.

5.15 call the appropriate IHttpHandler ProcessRequest method (or the asynchronous version of IHttpAsyncHandler...: BeginProcessRequest). For example, if the request is a page, the current page instance processes the request.

5.16 execute the PostRequestHandlerExecute event.

5.17 execute the ReleaseRequestState event.

5.18 execute the PostReleaseRequestState event.

5.19 perform response filter if the filter attribute is set.

5.20 execute the UpdateRequestCache event.

5.21 execute the PostUpdateRequestCache event.

5.22 execute the EndRequest event.

5.23 execute the PreSendRequestHeaders event.

5.24 execute the PreSendRequestContent event.

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.