ASP.Net MVC - Life Cycle Request

I am trying to do an MVC query lifecycle lookup.

I tried a lot on Google, but could not find it.

+7
asp.net-mvc-3 asp.net-mvc-4 asp.net-mvc-2
May 20 '13 at 10:55
source share
5 answers
+3
May 20 '13 at 11:38
source share

enter image description here

The following is a detailed explanation of the same.

Step 1 Fill out the route: - MVC queries are mapped to route tables, which, in turn, indicate which controller and action should be invoked. Therefore, if the request is the first request, the first thing you need is to populate the route table with the collection of routes. This filling of the route table occurs in the global.asax file.

Step 2 Selecting a route: - depending on the URL sent by "UrlRoutingModule", a search is made in the route table to create the "RouteData" object, which contains information about which controller and action to call.

Step 3 The request context has been created: - The "RouteData" object is used to create the "RequestContext" object.

Step 4 Created controller instance: - This request object is sent to the "MvcHandler" instance to create an instance of the controller class. When the controller class object is created, it calls the Run method of the controller class.

Step 5 Perform the action: - "ControllerActionInvoker" determines which action to perform and performs the action.

Step 6 The result is sent: - The action method executes and creates the type of result, which can be the result of the presentation, the result of the file, the result of JSON, etc.

Thus, there are six broad steps in everything that are performed in the MVC query life cycle.

kindly provided above image taken from this code article http://www.codeproject.com/Articles/556995/MVC-interview-questions-with-answers

+20
Mar 18 '14 at 10:30
source share

The following is the MVC life cycle:

- App initalization - Routing - Instantiate and execute controller - Lcate and invoke controller action - Instantiate and render View 
+6
May 20 '13 at 11:42
source share

ASP.NET MVC 5 Application Life Cycle - Published a week ago or so.

Here is a pdf file to download .

Hope this helps!

+2
Mar 05 '14 at 16:01
source share

In short. ASP.NET MVC uses ASP.NET Routing internally. When you see a MapRoute call, it is actually an extension method that will register a specific route for MvcRouteHandler .

This GetHttpHandler route handler will return an MvcHandler that is able to handle a request that matches the route.eg route http://yourdomain.com/ {controller} / {action}

0
May 20 '13 at 11:16
source share



All Articles