I'm looking for a more precise solution to handle requests for static contents by the ASP.NET lifecycle without setting runAllManagedModulesForAllRequests
to true.
As far as I know is the effect of runAllManagedModulesForAllRequests = "true"
that the precondition attribute of each module will be set to ""
.
The problem:
- I have to protect static content in a subfolder of a web application against unauthorized access
- To include requests to those static contents in the ASP.NET lifecycle and therefore having some events fired, I set
runAllManagedModulesForAllRequests
totrue
in web.config. - Because this solution turns the big wheel and all managed modules are affected for the whole application, I'm looking for a more adapted solution restricted to the subfolder where this behavior is required.
- I need a solution for IIS6 and II7
Question 1:
The preconditon of which modules have to be resetted (precondition = ""
) to fire global.asax.cs events (e.g. Application_BeginRequest
) for requests for static contents?
Question 2:
Is it possible to limit this request handling to requests to a single subfolder (e.g. perhaps by placing an adapted web.config in this subfolder, tweeking the main web.config, ...)
Any suggestions would be appreciated. Thanks.