MVC and pipelines
Version:
This topic describes the pipelines and the processors Sitecore MVC uses.
MVC-specific processors
MVC-specific processors
Some standard Sitecore pipelines have processors that are specifically used for Sitecore MVC. This table shows what they are:
| Pipeline | Processors |
|---|---|
| Initialize |
|
| HttpBeginRequest |
|
MVC-specific pipelines
MVC-specific pipelines
The following table lists all of the Sitecore pipelines that are only used by MVC:
| Pipeline | Description |
|---|---|
| RequestBegin | This is the first action of an MVC request after the request has been passed down from the main HttpRequest pipeline.A PageContext is created and assigned to the current thread. If the request is a form post, the associated form handler (if any) is executed. |
| RequestEnd | This is the last action of an MVC request. This pipeline is not currently used. |
| CreateController | This pipeline is called by the SitecoreControllerFactory to create a controller for the current route selected by the MVC request handler.If the requested item ( PageContext.Item) specifies a controller (in the __Controller Name field), this controller is instantiated and returned. Otherwise, an instance of the default SitecoreController is returned. |
| ActionExecuting | This pipeline executes before an MVC controller action is executed. This pipeline is not currently used. |
| ActionExecuted | This pipeline executes after an MVC controller action is executed. This pipeline is not currently used. |
| ResultExecuting | This pipeline executes before an MVC result is executed. This pipeline is not currently used. |
| ResultExecuted | This pipeline executes after an MVC result is executed. This pipeline is not currently used. |
| Exception | This pipeline executes after the MVC runtime catches an unhandled exception. This pipeline is not currently used. If you attach a custom processor to this pipeline, this processor should set the ExceptionContext.ExceptionHandled property on the ExceptionArgs object that is handed to the processor. Otherwise, Sitecore will do standard error handling. |
| GetPageItem | This pipeline resolves the item that was requested using route information. If the item cannot be resolved from the route, Context.Item is used. |
| BuildPageDefinition | This pipeline builds the initial PageDefinition by using the XML-based layout definition of the Renderings field on the page item. |
| GetPageRendering | This pipeline selects the rendering to use as the root rendering of the page for creating the output of the current request. Currently, the root rendering is selected based solely on the current device ( PageContext.Device). |
| GetRenderer | This pipeline transforms an abstract rendering definition (rendering) into an object that can render output back to the client (renderer). |
| GetModel | This pipeline creates the model object to use when rendering an MVC view. This is typically a ASP.NET MVC 3 Razor view. If the pipeline returns no model, the view receives an instance of EmptyModel. This triggers a meaningful error message if the .cshtml file contains the @model directive and therefore expects a model. |
| RenderPlaceholder | This pipeline is called as part of the Html.Sitecore().Placeholder extension method. It handles nested placeholders, when applicable.By default, the pipeline finds all renderings matching the specified placeholder name in the current PageDefinition and renders them. It only renders child renderings if the rendering explicitly renders them, typically by calling Html.Sitecore().Inner(). |
| RenderRendering | The pipeline renders the specified rendering. This pipeline handles caching and sets up the IRenderingContext for accessing source items of the renderings. This supports nested renderings. |
If you have suggestions for improving this article, let us know!