In ASP., many HttpModule have been pre-defined, even registered in the server's Web site configuration file, and we can use the System folder C:\Windows\Microsoft.NET\Framework\v4.0.30319\ Config, find the Web. config, where you can find 14 HttpModule. As shown below:
<httpmodules> <!--complete the output cache management of ASP. OutputCacheModule configuration parameters are defined by the outputcache element of the caching child element of the system.web configuration element, when output caching is enabled, OutputCacheModule will register HttpApplication Resolverequestcache and Updaterequestcache two events to complete the management of the output cache - <Addname= "OutputCache"type= "System.Web.Caching.OutputCacheModule" /> <!--To complete the session management, the module configuration parameters are configured through the sessionstate child elements of the system.web configuration element in the configuration file. When session state management is enabled, SessionStateModule will register the HttpApplication acquirerequeststate,releaserequeststate, EndRequest three events complete session state management - <Addname= "Session"type= "System.Web.SessionState.SessionStateModule" /> <!--Windowsauthenticationmodule,formsauthenticationmodule,passportauthenticationmodule is used to complete the user's verification work. They are defined by the child elements authentication the system.web in the configuration file, and the Mode property is used to specify the authentication method that the Web site is currently using. That is, which module will be used to complete the verification work. In the case of authentication enabled, FormsAuthenticationModule and PassportAuthenticationModule will register HttpApplication authenticaterequest and endrequest events for user authentication processing 。 WindowsAuthenticationModule will register AuthenticateRequest event handling. - <Addname= "WindowsAuthentication"type= "System.Web.Security.WindowsAuthenticationModule" /> <Addname= "FormsAuthentication"type= "System.Web.Security.FormsAuthenticationModule" /> <Addname= "Passportauthentication"type= "System.Web.Security.PassportAuthenticationModule" /> <!--Rolemanagermodule,urlauthorizationmodule,fileauthorizationmodule is used for user authorization management, The configuration parameters for authorization management are derived from the authorization child elements of system.web. UrlAuthorizationModule and FileAuthorizationModule registered the HttpApplication authorizerequest event processing, which is used to check URL and file access rights. RoleManagerModule after the URL and file access authorization check passed, the user's identity and role to complete the authorization check, RoleManagerModule registered the HttpApplication postauthenticaterequest and endrequest event processing. - <Addname= "RoleManager"type= "System.Web.Security.RoleManagerModule" /> <Addname= "URLAuthorization"type= "System.Web.Security.UrlAuthorizationModule" /> <Addname= "Fileauthorization"type= "System.Web.Security.FileAuthorizationModule" /> <!--provides the identity of the anonymous user, whether the anonymous user identity is enabled, defined in the child element of the configuration file's system.web configuration element anonymousidentification, and how anonymous identities can be managed. Because the user is authenticated in the AuthenticateRequest event, the module registers the event handling of Postauthenticaterequest and assigns a unique anonymous identity to the user when the user is not authenticated. - <Addname= "anonymousidentification"type= "System.Web.Security.AnonymousIdentificationModule" /> <!--after. NET 2.0, provide personalized data management. This is a customized session state management, but the reading and saving of the personalization data can be fully controlled by the programmer, and provides a strong type of data access, which is explained in the configuration parameters of the module in System.Web's child element profile. When this personalization data management is enabled, module will register HttpApplication acquirerequeststate and endrequest event handling. - <Addname= "Profile"type= "System.Web.Profile.ProfileModule" /> <Addname= "Errorhandlermodule"type= "System.Web.Mobile.ErrorHandlerModule, System.Web.Mobile, version=4.0.0.0, Culture=neutral, publickeytoken= B03F5F7F11D50A3A " /> <Addname= "ServiceModel"type= "System.ServiceModel.Activation.HttpModule, System.ServiceModel.Activation, version=4.0.0.0, culture=neutral , publickeytoken=31bf3856ad364e35 " /> <Addname= "UrlRoutingModule-4.0"type= "System.Web.Routing.UrlRoutingModule" /> <Addname= "ScriptModule-4.0"type= "System.Web.Handlers.ScriptModule, System.Web.Extensions, version=4.0.0.0, Culture=neutral, publickeytoken= 31bf3856ad364e35 "/></httpmodules>
ASP. HttpModule Predefined