ASP.NET MVC 4 intercept all incoming requests

The most correct way would be to create a class that inherits ActionFilterAttribute and override OnActionExecuting method. This can then be registered in the GlobalFilters in Global.asax.cs

Of course, this will only intercept requests that actually have a route.

Leave a Comment