Monday, February 18, 2008

HTTP PipeLine and Application / Page Events


See the below three figures...









1. The ASP.NET HTTP pipeline relies on IIS to receive the request.

2. When IIS receives an HTTP request, it examines the extension of the file.

3. If the file extension is associated with executable code, IIS invokes that code, in order to process the request.

4. Mappings from file extensions to pieces of executable code (.exe) are recorded in the IIS metabase.

5. When ASP.NET is installed, it adds entries to the metabase (associating various standard file extensions, including .aspx and .asmx), with a library called aspnet_isapi.dll.

6. When IIS receives an HTTP request for one of these files, it invokes the code in aspnet_isapi.dll, which in turn funnels the request into the HTTP pipeline.

7. Aspnet_isapi.dll uses a named pipe to forward the request from the IIS to an instance of the ASP.NET worker process, aspnet_wp.exe.

8. The aspnet_wp.exe worker process uses an instance of the HttpRuntime class to process the request.



Below the diagrammatic representation of mixing Page-Events with Application-Events.








This life cycle of the ASP.NET page starts with a call to the ProcessRequest() method. This method begins by initializing the page's control hierarchy.

The life cycle of Page ends by handing off the Web page's HTML markup to the Web server, which sends it back to the client that requested the page.

1

Application_Start

2

Application_BeginRequest

3

Application_AuthenticateRequest

4

Application_AuthorizeRequest

5

Application_ResolveRequestCache

6

Session_Start

7

Application_AcquireRequestState

8

Application_PreRequestHandlerExecute

 

Page Life Cycle occurs, and at the end generated HTML is sent to the server. This HTML is then rendered by the client/browser.

This is the place where the Page events mentioned at the right side of figure 2 occurs.

9

Application_PostRequestHandlerExecute

10

Application_ReleaseRequestState

11

Application_UpdateRequestCache

12

Application_EndRequest

13

Application_PreSendRequestHeaders

14

Application_PreSendRequestContent

 

Form Displays



Blogged with Flock

No comments: