1 Answer

0 votes
by

Any web application first understands the request and depending on type of request, it sends out appropriate response. MVC application life cycle is not different, it has two main phases, first creating the request object and second sending our response to the browser.

The request object creation has four major steps,

Step 1: Fill route

Every MVC request is mapped to route table which specifies which controller and action to be invoked. If it is the first request, it fills the route table with route collection. This filling of route table happens in the global.asaxfile.

Step 2: Fetch route

Depending on the URL sent “UrlRoutingModule” searches the route table to create “RouteData” object. RouteData has the details of which controller and action to invoke.

Step 3: Request context created

The “RouteData” object is used to create the “RequestContext” object.

Step 4: Controller instance created

The coming request object is sent to “MvcHandler” instance to create the object of controller class. Once the controller class object is created, it calls the “Execute” method of the controller class.

Creating Response object:

This phase has two steps – Executing the action and finally sending the response as a result to the view.

Related questions

0 votes
asked Aug 18, 2019 in MVC Language by rahulsharma
0 votes
asked Aug 18, 2019 in MVC Language by rahulsharma
...