If you find this article useful, consider making a small donation to show your support for this web site and its content.
DiscountASP
AboutMe
About me:
Hi. My name is Farooq Kaiser and I'm a software developer from Toronto, Canada.

Understanding the MVC Application Execution Process

by Farooq Kaiser 2. July 2009 15:37

The following are the stages of execution for an MVC Web project. 

  1. In the Global.asax file, Route objects are added to the RouteTable object.
  2. The UrlRoutingModule module uses the first matching Route object in the RouteTablecollection 
    to create the RouteData object, which it then uses to create a RequestContext(IHttpContext) object.
  3. The MvcRouteHandler creates an instance of the MvcHandler and passes it the RequestContext instance.
  4. The MvcHandler object uses the RequestContext instance to identify the IControllerFactory object         

    (typically an instance of the DefaultControllerFactory class) to create the controller instance with.

  5. The MvcHandler instance calls the controller's Execute method.

  6. Most controllers inherit from the Controller base class. For controllers that do so, 
    theControllerActionInvoker object that is associated with the controller determines which 
    action method of the controller class to call, and then calls that method.

  7. A typical action method might receive user input, prepare the appropriate response data, 
    and then execute the result by returning a result type. The built-in result types   that can be executed        

    include the following: ViewResult (which renders a view and is the most-often used result type),        

    RedirectToRouteResult, RedirectResult, ContentResult and JsonResult.  

    The following diagram shows the stages of execution for an MVC Web project.  

 

Summary 

In this article, we looked at the ASP.net MVC application execution process. In next article we will look at MVC application structure.

 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: ,

asp.net

Comments

Jobs Autos Real estate Videos Power by Google