PageRenderTime 4ms CodeModel.GetById 2ms app.highlight 0ms RepoModel.GetById 1ms 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/////////////////////////////////////////////////////////////////////////////
 6Use:
 7
 8This sample introduces how to write custom Http Handler and Http Module and
 9 use them in ASP.NET web application on IIS.
10
11It includes two projects: CSASPNETCustomHttpHandlerandModule and 
12CustomHandlerandModuleProject.
13
14CSASPNETCustomHttpHandlerandModule is ASP.NET web application to use custom
15Http Handler and Module.
16 
17CustomHandlerandModuleProject is Class Library project to implement custom
18Http Handler and Module.
19
20The sample can be running on IIS 7.0 directly. To use it on IIS 6 or earlier 
21version, we need to register the extension .demo in aspnet_isapi.dll.
22
23
24/////////////////////////////////////////////////////////////////////////////
25Creation:
26
27Step1. Create Class Library project named "CustomHandlerandModuleProject".
28
29Step2. Add two classes to inherit IHttpHandler and IHttpModule to implement
30its methods. 
31
32   note: Need to add reference to System.Web assembly.
33
34Step3. Create ASP.NET web application named "CSASPNETCustomHttpHandlerandModule".  
35
36Step4. Add reference to project "CustomHandlerandModuleProject" from 
37CSASPNETCustomHttpHandlerandModule and registercustom Http Handler and Module 
38in IIS:
39 
40<handlers>
41	<add name="CustomHandlerFor.demo" verb="*" path="*.demo" type="CustomHandlerandModuleProject.CustomHttpHandler"/>
42</handlers>
43
44<modules>
45	<add name="CustomModule" type="CustomHandlerandModuleProject.CustomHttpModule"/>
46</modules>
47
48Step5. Publish ASP.NET web application and deploy it on IIS 7 and request 
49default.htm page to view sample.
50
51
52/////////////////////////////////////////////////////////////////////////////
53References:
54
55HTTP Handlers and HTTP Modules Overview
56http://msdn.microsoft.com/en-us/library/bb398986.aspx
57
58How to: Configure an HTTP Handler Extension in IIS
59http://msdn.microsoft.com/en-us/library/bb515343.aspx
60
61Walkthrough: Creating and Registering a Custom HTTP Module
62http://msdn.microsoft.com/en-us/library/ms227673.aspx
63
64/////////////////////////////////////////////////////////////////////////////