Introducing HTTPHandlers
page 1 of 4
Published: 07 Sep 2002
Unedited - Community Contributed
Abstract
This article takes an in-depth look at HTTPHandlers, including their creation, implementation and the undocumented ASHX file.
by . .
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 26050/ 57

Introduction
Introduction

The life of an ASP.NET Request introduced HTTPHandlers (among other things) and you found out that everything eventually gets sent to an HTTPHandler (even the Page object) is an HTTPHandler. This article will look at HTTPHandlers in-depth an the creation and use of them, it will also take a look into HTTPHandler files (ASHX files).

Their Purpose in Life

All an HTTPHandler does really is take an HTTPContext object and work out what to do with it. Although that is a very simple analogy of them. The best way to describe it would be with an example -

Usually you associate an HTTPHandler with either a new file type (eg. ".AGASP") or with a .ASHX file. In the pipeline, the Handler is called last and when it is called, the appropriate HTTPHandler is executed. The handler can print information out or analyze information. The HTTPApplication object will call the HTTPHandler to process the request and generate a response.

So, for example, I can associate an HTTPHandler with the .stime extension and get it print out the server time when called.

They differ from HTTPModules because they only have one method, one property and no events -

Public Interface IHTTPHandler
Public ReadOnly Property IsReuseable as Boolean
Public Sub ProcessRequest(context as HttpContext)
End Interface

 


View Entire Article

User Comments

No comments posted yet.

Product Spotlight
Product Spotlight 





Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-10-16 12:11:48 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search