ASP.NET MVC Pipeline.pdf - Telerik

15 downloads 892 Views 16KB Size Report
You are getting out of the default MVC workflow. ... 5. 2. 6. 3. 4. 10. 11. 1. Validation rules. ASP.NET MVC Pipeline the lifecycle of a request in ASP.NET MVC.
Controller Creation

ASP.NET MVC Pipeline

You are not going to enter the MVC pipeline, you are on your own now

the lifecycle of a request in ASP.NET MVC by Simone Chiaretta

MvcHandler

3

Custom

MvcRouteHandler

Incoming request

DependencyResolver finds and create instance of Controller

Controller Factory

What type of IRouteHandler ?

Routing

2 Evaluate requested URL against route Definition (including iRouteConstraint)

is the route valid?

Yes

IRouteHandler Controller

ActionInvoker

Custom

You are getting out of the default MVC workflow. You have to handle action and result execution by yourself

No

Action Execution

ControllerActionInvoker

Select next route

Action to execute is chosen based on name via ActionNameSelectorAttrlbute

1 The response is returned to the browser

4

Action to execute is chosen based on other logic via ActionMethodSelectorAttrlbute

Result Execution Result Filters (OnResultExecuted ) are executed

Model Binder de-serializes parameters

IValidateObject

Validation logic

Html Helper, AjaxHelper , UrIHelper generate needed HTML code

ActionResult custom execution

5

Model Binder validates parameters

View rendering Model Validation Provider Retrieves validation rules

Validation rules

Authorization Filters

are executed

Validation rules

is authorized?

11

Javascript validation logic is added

Filters

Yes

HtmlHelper Templated Helper renders HTML of forms

Validation rules

Model Validation Provider Retrieves model visualization info

6

Action Filters (OnActlonExecuting ) are executed

DependencyResolver finds and create instance of Filters

IFilterProvlder finds filters applied to Action

Filters

template

IView

10

TemplateHelper templates

Execution stopped?

No

DependencyResolver finds and create instance of I View

All IVIewEngine registered are probed to find the view to render

No

9

Filters

Yes

Action parameters are filled with values

7

8

ViewResult

Action is executed

Other Kind

What kind of ActionResult ?

Result Filters (OnResultExecuting ) are executed

ActionResult

Action Filters (OnActlonExecuted ) are executed

Filters Filters

Note: All the extensibility points are in bold For clarity, the DependencyResolver is in 3 different boxes, because it retrieves 3 different types of objects, but it is always the same object. All the "helper objects' (the dependency resolver , the various providers etc) are outside the main execution flow to show their status as helpers to the main process.

© Simple Talk September 2011