Conditional HttpHandler: how to make certain requests return the default response?
I'm working on an IHttpHandler implementation which will handle all *.gif files. The Handler itself will have code in it to check whether the *.gif files are requested from a certain URL. If this is the case, some customer logic should be perform开发者_如何学Goed to put a customer gif in the response.
But I don't know what to do when a regular gif is requested. This should be processed as normal. How do I do this?
I would advice you have your generic handler serve only special/dynamic gif
files which could be requested like that: myhandler.ashx?file=name
and leave IIS handle normal .gif
files. Once you associate the ASP.NET runtime with the .gif
extension in IIS, you will have to implement static files serving which might not be as robust as in IIS.
精彩评论