Request interception in ASP.NET MVC Framework

Is it possible to intercept requests in the ASP.NET MVC Framework (beta 1) to interact and validate them?

I need to attach some logging and in some cases work dynamically if the URL requires authorization (for example, using the Authorize attribute, but at runtime).

+4
source share
3 answers

Filters in MVC are applied at compile time, but run at runtime. You can implement a custom authorization filter that will validate the URL and selectively allow. This will probably help if you provide more details about the script you are trying to execute.

+1
source

Standard HttpModules work fine.

You can also add your own IRouteHandler and specifically register routes with this (or capture the current route definitions and replace them with your route handler).

This will give you the flexibility you need.

+2
source

All Articles