From a programmer's point of view, HttpHandlers and HttpModules are nothing but classes that implement certain interfaces. HttpHandlers must implement the IHttpHandler interface. Some built-in classes such as HttpApplication and Page already implement the IHttpHandler interface. Similarly, new HttpModule-derived classes must implement the IHttpModule interface. Again, the Framework contains built-in classes such as FormsAuthenticationModule and WindowsAuthenticationModule that already implement the IHttpModule interface. Both interfaces reside in the System.Web namespace.
The IHttpHandler interface is extremely simple. The interface consists of a read only property named
IsReusable, which returns a Boolean value (typically
true) indicating whether another request can use the IHttpHandler instance, and a
ProcessRequest method, which takes a parameter of type HttpContext and performs the job of handling the extension.
[Visual Basic]
ReadOnly Property IsReusable As Boolean
Sub ProcessRequest(ByVal context As HttpContext)
[C#]
bool IsReusable {get;}
void ProcessRequest(HttpContext context);