I feel like the execution flow from a request to the view is a more complicated than WebForms. Maybe it's because more of the WebForms is hidden. Or maybe it's because I never thought about it.
Regardless, this is the execution flow in MVC.NET
Regardless, this is the execution flow in MVC.NET
- Request comes into ASP.NET
- ASP.NET Routing finds the route match by calling RouteCollection.GetRouteData
- This in turn calls RouteBase.GetRouteData on each route until it finds a match
- The IRouteHandler for the matching route has its GetHttpHandler method called
- The MvcHandler runs (ProcessRequest is called)
- The MVC controller factory locates and creates the controller in CreateController
- The ControllerActionInvoker determines which action to run in InvokeAction
- The AuthorizationFilter stage executes (this includes the authorization method on the controller itself)
- The ActionExecuting stage executes
- The requested action method is executed
- The ActionExecuted stage executes
- If there is a result object then the ResultExecuting stage executes
- If the result wasn't cancelled then the ActionResult's ExecuteResult method is executed
- The ResultExecuted stage executes
- If an error occured then the Exception stage executes

No comments:
Post a Comment