Preventing Static Content from Being Intercepted by an ASP.NET HttpModule
I am cleaning up some code in one of my projects using NHibernate and ASP.NET MVC and decided to rewrite my NHibernate code to use an HttpModule to create a Session Per Request. When debugging, I noticed that a session was being created for everying incoming request, including for static content like the .js and .css files and all my images.
Apparently, when impleneting an HttpModule you can choose to intercept all incoming requests, or just requests for dynamic content by changing a setting in the web.config file.
<modules runAllManagedModulesForAllRequests="false">I found the solution to this at StackOverflow and IIS.Net.




