Class RenderController
Represents the default front-end rendering controller.
Inheritance
System.Object
Microsoft.AspNetCore.Mvc.ControllerBase
Microsoft.AspNetCore.Mvc.Controller
Namespace: Umbraco.Cms.Web.Common.Controllers
Assembly: Umbraco.Web.Common.dll
Syntax
[ModelBindingException]
public class RenderController : UmbracoPageController, IActionFilter, IAsyncActionFilter, IFilterMetadata, IDisposable, IRenderController, IDiscoverable
Constructors
View SourceRenderController(ILogger<RenderController>, ICompositeViewEngine, IUmbracoContextAccessor)
Initializes a new instance of the RenderController class.
Declaration
public RenderController(ILogger<RenderController> logger, ICompositeViewEngine compositeViewEngine, IUmbracoContextAccessor umbracoContextAccessor)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.Extensions.Logging.ILogger<RenderController> | logger | |
Microsoft.AspNetCore.Mvc.ViewEngines.ICompositeViewEngine | compositeViewEngine | |
IUmbracoContextAccessor | umbracoContextAccessor |
Properties
View SourceUmbracoContext
Gets the umbraco context
Declaration
protected IUmbracoContext UmbracoContext { get; }
Property Value
Type | Description |
---|---|
IUmbracoContext |
Methods
View SourceCurrentTemplate<T>(T)
Gets an action result based on the template name found in the route values and a model.
Declaration
protected override IActionResult CurrentTemplate<T>(T model)
Parameters
Type | Name | Description |
---|---|---|
T | model | The model. |
Returns
Type | Description |
---|---|
Microsoft.AspNetCore.Mvc.IActionResult | The action result. |
Type Parameters
Name | Description |
---|---|
T | The type of the model. |
Remarks
If the template found in the route values doesn't physically exist, Umbraco not found result is returned.
Index()
The default action to render the front-end view.
Declaration
public virtual IActionResult Index()
Returns
Type | Description |
---|---|
Microsoft.AspNetCore.Mvc.IActionResult |
OnActionExecutionAsync(ActionExecutingContext, ActionExecutionDelegate)
Before the controller executes we will handle redirects and not founds
Declaration
public override async Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Mvc.Filters.ActionExecutingContext | context | |
Microsoft.AspNetCore.Mvc.Filters.ActionExecutionDelegate | next |
Returns
Type | Description |
---|---|
Task |