Search Results for

    Show / Hide Table of Contents
    View Source

    Class RenderController

    Represents the default front-end rendering controller.

    Inheritance
    System.Object
    Microsoft.AspNetCore.Mvc.ControllerBase
    Microsoft.AspNetCore.Mvc.Controller
    UmbracoController
    UmbracoPageController
    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 Source

    RenderController(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 Source

    UmbracoContext

    Gets the umbraco context

    Declaration
    protected IUmbracoContext UmbracoContext { get; }
    Property Value
    Type Description
    IUmbracoContext

    Methods

    View Source

    CurrentTemplate<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.

    View Source

    Index()

    The default action to render the front-end view.

    Declaration
    public virtual IActionResult Index()
    Returns
    Type Description
    Microsoft.AspNetCore.Mvc.IActionResult
    View Source

    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
    System.Threading.Tasks.Task
    • Improve this Doc
    • View Source
    In This Article
    • Constructors
      • RenderController(ILogger<RenderController>, ICompositeViewEngine, IUmbracoContextAccessor)
    • Properties
      • UmbracoContext
    • Methods
      • CurrentTemplate<T>(T)
      • Index()
      • OnActionExecutionAsync(ActionExecutingContext, ActionExecutionDelegate)
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX