PageRenderTime 35ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/Visual Studio 2008/CSASPNETCustomHttpHandlerandModule/CSASPNETCustomHttpHandlerandModule/ReadMe.txt

#
Plain Text | 64 lines | 42 code | 22 blank | 0 comment | 0 complexity | 552fd1f1208b0cc1f4ecd7f23204c2d9 MD5 | raw file
  1. ========================================================================
  2. ASP.NET APPLICATION: CSASPNETCustomHttpHandlerandModule Project Overview
  3. ========================================================================
  4. /////////////////////////////////////////////////////////////////////////////
  5. Use:
  6. This sample introduces how to write custom Http Handler and Http Module and
  7. use them in ASP.NET web application on IIS.
  8. It includes two projects: CSASPNETCustomHttpHandlerandModule and
  9. CustomHandlerandModuleProject.
  10. CSASPNETCustomHttpHandlerandModule is ASP.NET web application to use custom
  11. Http Handler and Module.
  12. CustomHandlerandModuleProject is Class Library project to implement custom
  13. Http Handler and Module.
  14. The sample can be running on IIS 7.0 directly. To use it on IIS 6 or earlier
  15. version, we need to register the extension .demo in aspnet_isapi.dll.
  16. /////////////////////////////////////////////////////////////////////////////
  17. Creation:
  18. Step1. Create Class Library project named "CustomHandlerandModuleProject".
  19. Step2. Add two classes to inherit IHttpHandler and IHttpModule to implement
  20. its methods.
  21. note: Need to add reference to System.Web assembly.
  22. Step3. Create ASP.NET web application named "CSASPNETCustomHttpHandlerandModule".
  23. Step4. Add reference to project "CustomHandlerandModuleProject" from
  24. CSASPNETCustomHttpHandlerandModule and registercustom Http Handler and Module
  25. in IIS:
  26. <handlers>
  27. <add name="CustomHandlerFor.demo" verb="*" path="*.demo" type="CustomHandlerandModuleProject.CustomHttpHandler"/>
  28. </handlers>
  29. <modules>
  30. <add name="CustomModule" type="CustomHandlerandModuleProject.CustomHttpModule"/>
  31. </modules>
  32. Step5. Publish ASP.NET web application and deploy it on IIS 7 and request
  33. default.htm page to view sample.
  34. /////////////////////////////////////////////////////////////////////////////
  35. References:
  36. HTTP Handlers and HTTP Modules Overview
  37. http://msdn.microsoft.com/en-us/library/bb398986.aspx
  38. How to: Configure an HTTP Handler Extension in IIS
  39. http://msdn.microsoft.com/en-us/library/bb515343.aspx
  40. Walkthrough: Creating and Registering a Custom HTTP Module
  41. http://msdn.microsoft.com/en-us/library/ms227673.aspx
  42. /////////////////////////////////////////////////////////////////////////////