Depending on what exactly you want to do, you can use the default controller, which is extended by all other controllers. This way you can override OnActionExecuting or Initialize and do your check there.
public class ApplicationController : Controller { protected override void OnActionExecuting(ActionExecutingContext filterContext) {
source share