October 2010
Intermediate to advanced
1920 pages
73h 55m
English
IHttpHandler InterfaceThe big disadvantage of a Generic Handler is that you cannot map a Generic Handler to a particular page path. For example, you cannot execute a Generic Handler whenever someone requests a file with the extension .gif. If you need more control over when an HTTP Handler executes, you can create a class that implements the IHttpHandler interface.
For example, the class in Listing 31.16 represents an Image HTTP Handler. This handler retrieves an image from a database table and renders the image to the browser.
Listing 31.16. App_Code\ImageHandler.cs

After you create a class that implements the IHttpHandler ...