I do not believe that there is a ready-made way to do this. The easiest way to do this for simple sites is to simply apply a filter at the controller level. This is pretty common, and it's usually nice to have your own base controller class in case this happens when you want to extend it to all your controllers. For instance:.
[MyActionFilter]
public class MyBaseController : Controller
{
...
}
public class HomeController : MyBaseController
{
...
}
, , , . , , , .