views:

24

answers:

1

According to documents it's clear how to register HttpHandlers in IIS 7.0 integrated mode if you implement IHttpHandler inside a dll and put it in Bin folder of web application. Then adding a line in web.config of that application completes the registeration process. There is an .ASHX file type which implements IHttpHandler by default. Since this file is not compiled into dll in Bin folder (and I didn't find where it go after compilation) any try to add correct type for it in web.config failed for me. web.config:

<handlers>
   <add name="MyHandler" path="*" verb="*" type="MyHandler, Myhandler"resourceType="unspecified" precondition"integratedmode" />
</handlers>

Question: How to register HttpHandlers written in .ASHX files ?

A: 

You don't register, you just call your ashx-file like a regular aspx, asmx or html file. http://yourweb.com/yourhandler.ashx :)

Onkelborg
I want capture all calls to a virtual directory without anything like a page address in url, i.e: http://localhost/myVirtualDirectory instead of http://localhost/myVirtualDirectory/myHandler.ashx then you say I cannot do that with ashx file and should register a dll ?
Xaqron
Make a confirm, I gonna accept it as the answer
Xaqron
@Xaqron: If that's what you want then it's url rewriting you are looking for :)
Onkelborg
I'm gonna accept everything in URL, this is different from URL rewriting
Xaqron
Hm, I see no reason why you shouldn't be able to redirect everything to your handler?
Onkelborg