Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exclude certain pages from using a HTTPModule

Tags:

People also ask

What is the difference between HttpModule and HTTP handler?

HTTP handler is the process that runs in response to a request made to an ASP.NET Web application. HTTP modules let you examine incoming and outgoing requests and take action based on the request.

What is HTTP handler and HttpModule in MVC?

To explain HTTP Modules and HTTP Handlers, HTTP module and HTTP handler are used by MVC to inject pre-processing logic in the request chain. HTTP Handlers are extension based pre-processor whereas HTTP Module are event based preprocessor.

What is HttpModule MVC?

An HTTP module is an assembly that is called on every request to an application. It's a part of the HTTP request and response pipeline. Even the ASP.NET engine uses HttpModule to perform certain operations (which are outside our interests here).


Is there a good way to exclude certain pages from using a HTTP module?

I have an application that uses a custom HTTP module to validate a session. The HTTPModule is set up like this in web config:

<system.web>
  <!-- ... -->
  <httpModules>
    <add name="SessionValidationModule"
       type="SessionValidationModule, SomeNamespace" />
  </httpModules>
</system.web>

To exclude the module from the page, I tried doing this (without success):

<location path="ToBeExcluded">
  <system.web>
    <!-- ... -->
    <httpModules>
      <remove name="SessionValidationModule" />
    </httpModules>
  </system.web>
</location>

Any thoughts?