Asp.net HTTP custom handler before another ashx HTTP handler

I wrote a .ashx http address handler. I also have a custom HTTP handler that I added to the web.config file:

<httpHandlers> <add verb="*" path="*.aspx" type="AspxHandler"/> </httpHandlers> 

and I want the call to go to my custom HTTP handler before it goes to the ashx HTTP handler.

How can i do this?

+4
source share
1 answer

Handlers in ASP.NET are endpoints, so there can only be one request. You can, I really do something, and then pass it on. If you want your handler to run instead of the regular page handler, first remove the default ASPX handler, and then add your own. See MSDN for configuration file schema.

If you want to just run something in front of the handler and possibly affect the work of the handler, you need to implement IHttpModule

+2
source

All Articles