HttpApplication事件执行顺序
Instances of the HttpApplication class are created in the ASP.NET infrastructure, not by the user directly. One instance of the HttpApplication class is used to process many requests in its lifetime; however, it can process only one request at a time. Thus, member variables can be used to store per-request data.
An application executes events that are handled by modules or user code that is defined in the Global.asax file in the following sequence:
-
After the PostResolveRequestCache event and before the PostMapRequestHandler event, an event handler (a page corresponding to the request URL) is created.
-
PostMapRequestHandler
-
The event handler is executed.
-
After the PostReleaseRequestState event, response filters, if any, filter the output.