For more info on this topic, see
The IHttpHandler interface
http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemWebIHttpHandlerClassTopic.asp
URL Mapping in ASP.NET without extensions:
http://scottonwriting.net/sowblog/posts/943.aspx
--
To configure an HTTP Handler, you would specify something like this in the
web.config:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<httpHandlers>
<add verb="*" path="albums/*" validate="false"
type="nGallery.Lib.AlbumRequestHandler, nGalleryLib" />
</httpHandlers>
within the type="...", you specify the fully-qualified type name that
defines the IHttpHandler, and that type should be on the app's load path,
typically in the bin subdirectory.
Within that handler, you can do what you want. It is not restricted to URLs
that end in particular . The interface is simple, consisting of a single
method, ProcessRequest(), which feels something like the service() method of
the Java Servlet.
public void ProcessRequest(HttpContext context)
{
}
Now, for any request that arrives of the form
http://yourserver/albums/something/something ,
your handler gets called, and you decide what to do with the request:
handle it, rewrite the URL, forward the request, or do something else.
It's up to you. But the key is, your handler layers on ASP.NET, which in
turn depends on IIS. IIS needs to send the incoming request to ASP.NET
before your handler can be activated. By default, IIS sends only requests
with extensions like .aspx and .asmx to ASP.NET, so your handler won't get
activated, by default, for URLs that lack these extensions. In other words
you would need
http://yourserver/albums/something/something.aspx . The
second link above discusses how to activate your IHttpHandler for "all
requests" of any extension, and also some of the pitfalls of that technique.
-Dino