Monday, August 13, 2007
« Develop ASP.NET Apps under IIS7 on Vista... | Main | Special Guests at pashabitz.com »

ASP.NET provides an easy way to write custom http handlers. You simply implement the IHttpHandler interface and register your handler in the "web.config" section under system.web like this:

<httpHandlers>
  <add verb="*" path="*.my_extension" type="MyHanlders.Handler, MyHandlers" />
</httpHandlers>

This registers a class named Handler to handle requests to URLs with extension ".my_extension".
You still need to let the web server know about this extension, and configure it to pass processing of files with this extension to ASP.NET.

To do it in IIS7, add the following to your web.config, under the "configuration" section:

<system.webServer>
  <handlers>
    <add name="handler_name" path="*.my_extension" verb="*" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" resourceType="Unspecified" />
  </handlers>
</system.webServer>

Want to join me as partner in a cool new startup?
Get in touch: pasha at cohai dot co

Bookmark and Share Monday, August 13, 2007 9:25:33 PM (Jerusalem Daylight Time, UTC+03:00)  #    Comments [3]  
Saturday, April 16, 2011 10:22:52 PM (Jerusalem Daylight Time, UTC+03:00)
B4mZ3Q Great thinking! That really bareks the mold!
Saturday, April 23, 2011 8:40:00 PM (Jerusalem Daylight Time, UTC+03:00)
ZKeGzd <a href="http://nelpakolkulm.com/">nelpakolkulm</a>
Monday, April 25, 2011 12:33:06 AM (Jerusalem Daylight Time, UTC+03:00)
7hdRBf , [url=http://iajgeftgjkfp.com/]iajgeftgjkfp[/url], [link=http://ftlupcwkwigl.com/]ftlupcwkwigl[/link], http://msitckbijnvs.com/
Name
E-mail
Home page

Comment (HTML not allowed)  

Enter the code shown (prevents robots):