HttpApplication class has a method Init. It is virtual and called by ASP.NET runtime when initializing of a HttpApplication is almost finished i.e. all modules have been initialized and all event handlers in the Global.asax have been registered. It is also lat time when you can attach handlers to the HttpApplication events. The method is quite handy if you want to place your custom HttpApplication in a separate class library project.
I’ve used it to see which modules are registered for an application and subscribed for the application events, and how much time each stage of the request processing takes. The output looks like the following.
See attached file
Modules | HttpApplication event handlers | Timing | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
OutputCache Session WindowsAuthentication FormsAuthentication PassportAuthentication RoleManager UrlAuthorization FileAuthorization AnonymousIdentification Profile ErrorHandlerModule ServiceModel DefaultAuthentication | BeginRequest ASP.global_asax.Application_BeginRequest AuthenticateRequest System.Web.Security.WindowsAuthenticationModule.OnEnter System.Web.Security.PassportAuthenticationModule.OnEnter DefaultAuthentication System.Web.Security.DefaultAuthenticationModule.OnEnter PostAuthenticateRequest System.ServiceModel.Activation.HttpModule.ProcessRequest AuthorizeRequest System.Web.Security.UrlAuthorizationModule.OnEnter System.Web.Security.FileAuthorizationModule.OnEnter ResolveRequestCache System.Web.Caching.OutputCacheModule.OnEnter AcquireRequestState System.Web.Profile.ProfileModule.OnEnter AcquireRequestStateAsync System.Web.SessionState.SessionStateModule.BeginAcquireState System.Web.SessionState.SessionStateModule.EndAcquireState ReleaseRequestState System.Web.SessionState.SessionStateModule.OnReleaseState UpdateRequestCache System.Web.Caching.OutputCacheModule.OnLeave EndRequest System.Web.SessionState.SessionStateModule.OnEndRequest System.Web.Security.PassportAuthenticationModule.OnLeave System.Web.Profile.ProfileModule.OnLeave |
|