Reputation: 538
I have an application that depends on a generic HttpHandler I created, and it works fine. The problem is that that there are many other applications under the same folder in IIS, and these other apps don't need to use and don't know (mustn't know) about this handler. However, the Web.Config in which I register it ends up applying to all folders on the same level and all subfolders, and this is what I want to avoid.
Changing the structure of the apps inside IIS is not a possibility, unfortunately.
I thought of using the < location > tag on Web.config, but I'm under the impression it only changes rights to access and not visibility.
Any suggestions on how this can be overcome?
Upvotes: 1
Views: 461
Reputation: 8778
HttpHandlers are configured at the application level. Are these subfolders you speak of really separate applications? If not, there's not much you can do about it... Aristos' suggestion might be viable though. If they are really applications, you'll just have to specifically remove the handler from those applications.
http://msdn.microsoft.com/en-us/library/e0dzxdza%28VS.71%29.aspx
Upvotes: 0
Reputation: 66641
You can apply a custom filter to your HttpHandler by checking the file that is going to pass by your filter, and keep only the one you need.
You can get the file name that is going to pass your HttpHandler by
HttpContext.Current.Request.Path
In this file name you can check for anything, for a directory, for a file, for what ever.
Hope that this help.
Upvotes: 1
Reputation: 6042
I think you need to look at Configuration Inheritance, and ways around it for child apps. Maybe start here:
http://msdn.microsoft.com/en-us/library/ms178685.aspx
Upvotes: 0