How To Own ASP.Net MVC Page Life Cycle For Free mvc life cycle, mvc life cycle, mvc lifecycle in, mvc life cycle with example, mvc life cycle interview questions, mvc tutorial


Before to start over to know about MVC complete Life Cycle, it is mandatory to add required namespaces in web.config which are automatically added when we add MVC package in our MVC application. We all know the basic behaviour of MVC is based on HTTP requests. In my recent article, I have already explained how to create amazing charts using MVC.

I have provided all necessary MVC life cycle steps here.
<add namespace="System.Web.Helpers">
<add namespace="System.Web.Mvc">
<add namespace="System.Web.Mvc.Ajax">
<add namespace="System.Web.Mvc.Html">
<add namespace="System.Web.Optimization">
<add namespace="System.Web.Routing">
<add namespace="System.Web.WebPages">

1) We send our request through HTTP to our server.
2) Then request goes through our MVC routing.
3) Our web request sends through Global.asax file where all routes are registered under this file, according to our MVC request then request is forwarded according to matching route.
ASP.Net MVC Page Life Cycle

protected void Application_Start()
    //ModelBinders.Binders.DefaultBinder = new Microsoft.Web.Mvc.DataAnnotations.DataAnnotationsModelBinder();
4) Route is filled in Route.Config file where our controller, view and parameter (optional) are given to complete our request.

public static void RegisterRoutes(RouteCollection routes)
    name: "Default",
        url: "{controller}/{action}/{id}",
        defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
5) After filling the route through Route.config, now request is redirected to our controller.

  public ActionResult Index()
   return View();
6) At the end, Result is shown in a view of MVC controller attribute where all desired information is displayed over here.

@{ ViewBag.Title = "Home"; } 
<!DOCTYPE html> 
<html lang="en"> 
<head> <meta charset="utf-8" /> 
<link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" /> 
<meta name="viewport" content="width=device-width" /> 
 <body> <div> Welcome to Technology Crowds </div> </body> 


In this article has shown how works MVC life cycle when we request through HTTP in our web browser. Requests, Routing, controller, view, MVC handler (Razor etc) are key components of MVC.

Suggested Reading


Anjan Kant

Outstanding journey in Microsoft Technologies (ASP.Net, C#, SQL Programming, WPF, Silverlight, WCF etc.), client side technologies AngularJS, KnockoutJS, Javascript, Ajax Calls, Json and Hybrid apps etc. I love to devote free time in writing, blogging, social networking and adventurous life

Post A Comment: