Clarity, Technology, and Solving Problems | PracticeThis.com
WP7 App with Key Windows Azure resources – Slides, Videos, How-To’s, and T-shooting – for quick consumption on the go.
This post is made with PracticeThis.com plugin for Windows Live Writer
Receive first request for the application
In the Global.asax file, Route objects are added to the RouteTable object.
void Application_Start(object sender, EventArgs e)
public static void RegisterRoutes(RouteCollection routes)
, new CategoryRouteHandler()
The UrlRoutingModule module uses the first matching Route object in the RouteTable collection to create the RouteData object, which it then uses to create a RequestContext object.
Create MVC request handler
The MvcRouteHandler object creates an instance of the MvcHandler class and passes the RequestContext instance to the handler.
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.
The MvcHandler instance calls the controller's Execute method.
For controllers that inherit from the ControllerBase class, the ControllerActionInvoker object that is associated with the controller determines which action method of the controller class to call, and then calls that method.
The action method receives user input, prepares the appropriate response data, and then executes 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, JsonResult, FileResult, and EmptyResult.