Table of Contents

Class RenderController

Namespace
Umbraco.Cms.Web.Common.Controllers
Assembly
Umbraco.Web.Common.dll

Represents the default front-end rendering controller.

[ModelBindingException]
public class RenderController : UmbracoPageController, IActionFilter, IAsyncActionFilter, IFilterMetadata, IDisposable, IRenderController, IDiscoverable
Inheritance
RenderController
Implements
IDiscoverable
Inherited Members
Extension Methods

Constructors

RenderController(ILogger<RenderController>, ICompositeViewEngine, IUmbracoContextAccessor)

Initializes a new instance of the RenderController class.

public RenderController(ILogger<RenderController> logger, ICompositeViewEngine compositeViewEngine, IUmbracoContextAccessor umbracoContextAccessor)

Parameters

logger ILogger<RenderController>
compositeViewEngine ICompositeViewEngine
umbracoContextAccessor IUmbracoContextAccessor

Properties

UmbracoContext

Gets the umbraco context

protected IUmbracoContext UmbracoContext { get; }

Property Value

IUmbracoContext

Methods

CurrentTemplate<T>(T)

Gets an action result based on the template name found in the route values and a model.

protected override IActionResult CurrentTemplate<T>(T model)

Parameters

model T

The model.

Returns

IActionResult

The action result.

Type Parameters

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.

public virtual IActionResult Index()

Returns

IActionResult

OnActionExecutionAsync(ActionExecutingContext, ActionExecutionDelegate)

Before the controller executes we will handle redirects and not founds

public override Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next)

Parameters

context ActionExecutingContext
next ActionExecutionDelegate

Returns

Task