About

I'm Mike Pope. I live in the Seattle area. I've been a technical writer and editor for over 35 years. I'm interested in software, language, music, movies, books, motorcycles, travel, and ... well, lots of stuff.

Read more ...

Blog Search


(Supports AND)

Feed

Subscribe to the RSS feed for this blog.

See this post for info on full versus truncated feeds.

Quote

Tuchman's Law: The fact of being reported multiplies the apparent extent of any deplorable development by five- to ten-fold (or any figure the reader would care to supply).

Barbara Tuchman, historian



Navigation





<April 2025>
SMTWTFS
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910

Categories

  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  

Contact Me

Email me

Blog Statistics

Dates
First entry - 6/27/2003
Most recent entry - 4/17/2025

Totals
Posts - 2657
Comments - 2678
Hits - 2,737,675

Averages
Entries/day - 0.33
Comments/entry - 1.01
Hits/day - 344

Updated every 30 minutes. Last: 9:55 AM Pacific


  12:46 PM

Bertrand LeRoy illustrates how easy (well, relatively) it is in Whidbey/Visual Studio 2005 to create HttpHandlers (.ashx files). Ease of development aside, he points out that handlers are a comparatively less-understood feature in ASP.NET. He says: "There is little documentation about them in v1, and no support for them in Visual Studio 2003." From personal experience (on both sides of the docs) I concur heartily, unfortunately, with the first point he makes.

Even in v1, though, handlers are not hugely difficult to create. The QuickStarts have a simple example that's a good start for most people.

Aside from handlers not being very well documented, I think that the virtues and purpose of handlers are not very well advertised, especially for Mort+ developers, let's call them -- folks who are a step or two beyond simple page development. Advanced developers are usually facile with them, but the existence and choice of handlers is, IMO, not well presented for people coming up to speed in ASP.NET. The best introduction I got to handlers was a presentation by Stephen Walther, who did a great demo at a user group meeting of HttpHandlers and HttpModules.

In particular, I think that ASP.NET noobies tend to be led to create .aspx pages for almost every purpose, basically because you can. You can create an RSS feed, for example, using an .aspx page, even though there is nothing in an RSS feed that constitutes a page in the ASP.NET sense. I was talking to Nikhil about this a while back. Nikhil is a design purist, and if I understand him right, he believes that you should never use an .aspx file for anything other than HTML rendering. To him it seems obvious that the way to create an RSS feed is via a handler, and in his blog[1] that's what he does for his feed. More generally: if the request endpoint renders markup, then (and only then) use an .aspx page. Otherwise, use a different endpoint, which often is a handler. Bertrand's illustation is a dynamic image, which is another great example of when to use a handler.

Here are some more resources on creating handlers:

Using HTTP Modules and Handlers to Create Pluggable ASP.NET Components

http://www.devx.com/dotnet/Article/6962/0/page/1

Using ASP.NET HTTP Handlers to create a photo album

One of these days I'll get around to implementing handlers for some of the functionality on this blog, like the aforementioned RSS feed.

[1] From which I, er, leveraged a number of design ideas when I was first creating my blog. Though not the handler-for-RSS idea. :-)

Update 3/17/05  Scott Hanselman has a
blog post that reiterates the purpose of HttpHandlers and that includes his HttpHandler boilerplate template.

[categories]   ,

[1] |