Question

I am looking into identifying handler that will handle my request. I would like to know if request is asking for static resource (that is css,js or image files). Upon inspecting HttpContext.Request on PreRequestHandlerExecute Event i see that handler and currentHandler variables are null for static resources and for any other custom handlers or aspx pages i have handler and currentHandler variables.

My question is: Is the is good place to differ handlers that will handle request or not? I would like not to identify handler file extension by taking it from system.web/httpHandlers, cause i would like not to use system.web/httpHandlers just system.webServer/handlers. And i don't want to use Microsoft.Web.Administration namespace cause that will make me modify configurations on all servers.

Was it helpful?

Solution

Forgot to make an update on how i resolved it. I actually do deffer native from custom handlers on PostMapRequestHandler event. If your request will be handled by native handler than handler and currentHandler vars of HttpContext.Request will be null. Also by setting runAllManagedModulesForAllRequests to false request that will be handled by native handlers want even raise PostMapRequestHandler event. Hope this helps someone.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top