I want to be able to execute some code for every request that stores data in ViewData. I currently have a base controller class that inherits all my controllers, and I override OnActionExecuting and do it there.
My only concern with this approach is that whoever ever creates a new controller HOPES to inherit the form of the base class.
Is there a way to register something in global.asax, as with custom model bindings that will trigger each request? Kinda as a global action filter or something like that.
source share