Skip to Content
ASP.NET 4 Unleashed
book

ASP.NET 4 Unleashed

by Stephen Walther, Kevin Hoffman, Nate Dudek
October 2010
Intermediate to advanced
1920 pages
73h 55m
English
Sams
Content preview from ASP.NET 4 Unleashed

Implementing the IHttpHandler Interface

The 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

images

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

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

ASP.NET 3.5 Unleashed

ASP.NET 3.5 Unleashed

Stephen Walther
ASP.NET 4.0 in Practice

ASP.NET 4.0 in Practice

Marco De Sanctis, Daniele Bochicchio, Stefano Mostarda

Publisher Resources

ISBN: 9780132565851Purchase book