MVC Application Life Cycle

There are six broader events which occur in MVC application life cycle and this event comes under two category that is Creating the request object and Creating Response object

Under Creating the request object we have:

  • Fill route All requests are mapped to route tables which in turn specify which controller and action to be invoked. This filling of route table happens in the global.asax file or Startup.cs if it is ASP.NET Core Application.
  • Fetch route Depending on the URL. The “UrlRoutingModule” searches the route table to create “RouteData” object which has the details of which controller and action to invoke.
  • Request context created The "RouteData" object is used to create the "RequestContext" object.
  • Controller instance created This request object is sent to “MvcHandler” instance to create the controller class instance.

Creating Response object

  • Executing the action
  • And finally sending the response as a result to the view.

results matching ""

    No results matching ""