---
title: "What is MVC application life cycle?"  
description: "What is MVC application life cycle?"  
author: "Anupam Mishra"  
published: 2016-02-15  
updated: 2020-09-23  
canonical: https://www.mindstick.com/interview/22986/what-is-mvc-application-life-cycle  
category: "asp.net"  
tags: ["c#", "asp.net", "asp.net mvc", "mvc"]  
reading_time: 4 minutes  

---

# What is MVC application life cycle?

Any web application has two main execution steps first understanding the request and depending on the type of the request sending out appropriate response. MVC application life cycle ,it has two main phases first creating the request object and second sending our response to the browser.**\****Creating Response object: -** \
The request object creation has four major steps. \
**Step 1.** **Fill route**: - MVC requests are mapped to route tables which in turn specify which controller and action to be invoked. So if the request is the first request the first thing is to fill the route table with routes collection. This filling of route table happens in the **global.asax** file.\
**Step 2.** **Fetch route:**- Depending on the URL sent "**UrlRoutingModule**" searches the route table to create "**RouteData**" object which 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**: - This request object is sent to "**MvcHandler**" instance to create the controller class instance. 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.\
**Step 5.** **Execute Action:** - The "**ControllerActionInvoker**" determines which action to executed and executes the action.\
**Step 6.** **Result sent:** - The action method executes and creates the type of result which can be a view result , file result , JSON result etc.So in all there are six broad steps which get executed in MVC application life cycle.For more details.Please click HERE

## Answers

### Answer by Shrikant Mishra

As we know that any web application has two main execution steps, first understanding the request and depending on the type of the request, sending out an appropriate response. **MVC application life cycle** has two main phases, first creating the request object and second sending the response to the browser.

When Creating the request object includes four basic steps:

**Step 1:** Fill route

**Step 2:** Fetch route

**Step 3:** Request context created

**Step 4:** Controller instance created

### Answer by Anupam Mishra

Any web application has two main execution steps first understanding the request and depending on the type of the request sending out appropriate response. MVC application life cycle ,it has two main phases first creating the request object and second sending our response to the browser.**\****Creating Response object: -** \
The request object creation has four major steps. \
**Step 1.** **Fill route**: - MVC requests are mapped to route tables which in turn specify which controller and action to be invoked. So if the request is the first request the first thing is to fill the route table with routes collection. This filling of route table happens in the **global.asax** file.\
**Step 2.** **Fetch route:**- Depending on the URL sent "**UrlRoutingModule**" searches the route table to create "**RouteData**" object which 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**: - This request object is sent to "**MvcHandler**" instance to create the controller class instance. 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.\
**Step 5.** **Execute Action:** - The "**ControllerActionInvoker**" determines which action to executed and executes the action.\
**Step 6.** **Result sent:** - The action method executes and creates the type of result which can be a view result , file result , JSON result etc.So in all there are six broad steps which get executed in MVC application life cycle.For more details.Please click HERE


---

Original Source: https://www.mindstick.com/interview/22986/what-is-mvc-application-life-cycle

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
