Are there any events before starting the controller?

I know that there are events before / after the start of the action.

Is there anything higher on the stack like before calling the controller?

+6
asp.net-mvc controller
source share
4 answers

There is no such thing as starting a controller. Controllers do not start. These are the classes that are created and the action (methods) is called on them.

You can decorate your action with the special attribute [ActionFilter] , in which you can override OnActionExecuting , which is called before the controller action is called. This method also allows you to better understand the problems.

+9
source share

ASP.Net MVC still works through the HttpApplication pipeline, so you can still handle any events from BeginRequest to PreRequestHandlerExecute by adding handlers to Global.asax.

+7
source share

Many application life cycle events can be processed in the Global.asax file.

+2
source share

See the following SO question that explains the life cycle in ASP.NET MVC.

What is the "page life cycle" of an ASP.NET MVC page compared to ASP.NET WebForms?

+1
source share

All Articles