Name

Handler

Synopsis

IHttpHandler = Context.Handler
Context.Handler = IHttpHandler

Sets or returns an instance of the IHttpHandler for the current request.

Parameters

IHttpHandler

An Object variable of a type that implements the IHttpHandler interface.

Notes

The Handler property can be used to specify special handling for this request. To understand this idea, you need to understand how requests are processed in IIS. When a request comes in, unless the item requested is a simple HTML file, the request is generally handled by an Internet Server API (ISAPI) extension. For instance, classic ASP and ASP.NET pages are directed to ISAPI applications that process the request. ISAPI applications are reasonably easy to write in principal, but are very difficult to create in practice. The IHttpHandler interface is the .NET way of allowing the developer to write code to for requests to be handled in a way similar to ISAPI applications in IIS, without all of the problems of ISAPI.

Get ASP.NET in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.