Analysis of ASP. NET Applications

Source: Internet
Author: User

The default HttpModule in ASP. NET:

The Default Authentication Module ensures that the Authentication object exists in the context. This class cannot be inherited.

FileAuthorizationModule verifies that the remote user has the NT permission to access the requested file. This class cannot be inherited.

Forms Authentication Module enables ASP. NET Applications to use Forms Authentication. This class cannot be inherited.

The Passport Authentication Module provides a wrap-around, Passport Authentication service. This class cannot be inherited.

SessionStateModule provides session status services for ASP. NET applications.

UrlAuthorizationModule provides URL-based authorization services to allow or deny access to specified resources. This class cannot be inherited.

Windows Authentication Module enables ASP. NET Applications to use Windows/IIS Authentication. Unable to inherit this class

The default HttpModule of these systems is in the file machine. the configuration in config and the web. the config relationship is in ASP. when the net framework starts to process an Http Request, it will load the machine in sequence. the web. config file. If an HttpModule is configured in the machine, you can still. remove the ing from the config file.

 
 
  1. publicclassHelloWorldModule:IHttpModule  
  2. {  
  3. publicHelloWorldModule()  
  4. {  
  5. }  
  6.  
  7. publicStringModuleName  
  8. {  
  9. get{return"HelloWorldModule";}  
  10. }  
  11.  
  12. //IntheInitfunction,registerforHttpApplication  
  13. //eventsbyaddingyourhandlers.  
  14. publicvoidInit(HttpApplicationapplication)  
  15. {  
  16. application.BeginRequest+=  
  17. (newEventHandler(this.Application_BeginRequest));  
  18. application.EndRequest+=  
  19. (newEventHandler(this.Application_EndRequest));  
  20. }  
  21.  
  22. privatevoidApplication_BeginRequest(Objectsource,  
  23. EventArgse)  
  24. {  
  25. //CreateHttpApplicationandHttpContextobjectstoaccess  
  26. //requestandresponseproperties.  
  27. HttpApplicationapplication=(HttpApplication)source;  
  28. HttpContextcontext=application.Context;  
  29. context.Response.Write("<h1><fontcolorfontcolor=red>
    HelloWorldModule:BeginningofRequest font> h1><hr>");  
  30. }  
  31.  
  32. privatevoidApplication_EndRequest(Objectsource,EventArgse)  
  33. {  
  34. HttpApplicationapplication=(HttpApplication)source;  
  35. HttpContextcontext=application.Context;  
  36. context.Response.Write("<hr><h1><fontcolorfontcolor=red>
    HelloWorldModule:EndofRequest font> h1>");  
  37. }  
  38.  
  39. publicvoidDispose()  
  40. {  
  41. }  
  42. }  
  43. <system.web> 
  44. <httpModules> 
  45. <addnameaddname="HelloWorldModule"type="HelloWorldModule"/> 
  46. httpModules> 
  47. system.web> 
  1. Introduction to ASP. net mvc implementation
  2. How to send emails from ASP. NET 2.0
  3. Introduction to ASP. NET Applications
  4. ViewState nature in ASP. NET
  5. Installing ASP. NET AJAX

Related Article

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.