[%siteTitle%]
Search Results for

    [%custom-skipDocumentationFor%]
    Show / Hide Table of Contents
    NamespaceSystemLibrary.Common.Episerver.Components SystemLibrary.Common.Episerver.dll

    Block Components without a specific 'AsyncComponent' will automatically inherit and use this

    This assumes by convention, that there is then a 'Index.cshtml' or 'BlockName.cshtml' file located at the 'DefaultComponentPathPredicate' for the specific Block Type

    Or; in other words-ish: In the same folder next to the "BlockData.cs" file, there should be a view file
    Remarks
    X

    Important to note that this is only in use if you do not bother creating your own Component.cs file (previously named BlockControllers)

    _DefaultBlockComponent

    [TemplateDescriptor(Inherited = true)] public class _DefaultBlockComponent : AsyncComponent<BlockData>, IRenderTemplate<BlockData>, IRenderTemplate

    Inheritance
    System.Object
    Microsoft.AspNetCore.Mvc.ViewComponent
    EPiServer.Web.Mvc.AsyncPartialContentComponent<EPiServer.Core.BlockData>
    EPiServer.Web.Mvc.AsyncBlockComponent<EPiServer.Core.BlockData>
    AsyncComponent<EPiServer.Core.BlockData>
    _DefaultBlockComponent
    Implements
    EPiServer.Web.IRenderTemplate<EPiServer.Core.BlockData>
    EPiServer.Web.IRenderTemplate
    Inherited Members
    AsyncComponent<BlockData>.ResultAsync(Object, String)
    AsyncComponent<BlockData>.Result(Object, String)
    AsyncComponent<BlockData>.ReactServerSideResultAsync(Object, Object, Boolean, Boolean, Boolean, String, String, String, String, Boolean)
    AsyncComponent<BlockData>.ReactServerSideResult(Object, Object, Boolean, Boolean, Boolean, String, String, String, String, Boolean)
    EPiServer.Web.Mvc.AsyncPartialContentComponent<EPiServer.Core.BlockData>.InvokeAsync(EPiServer.Core.BlockData)
    Microsoft.AspNetCore.Mvc.ViewComponent.Content(System.String)
    Microsoft.AspNetCore.Mvc.ViewComponent.View()
    Microsoft.AspNetCore.Mvc.ViewComponent.View(System.String)
    Microsoft.AspNetCore.Mvc.ViewComponent.View<TModel>(TModel)
    Microsoft.AspNetCore.Mvc.ViewComponent.View<TModel>(System.String, TModel)
    Microsoft.AspNetCore.Mvc.ViewComponent.HttpContext
    Microsoft.AspNetCore.Mvc.ViewComponent.Request
    Microsoft.AspNetCore.Mvc.ViewComponent.User
    Microsoft.AspNetCore.Mvc.ViewComponent.UserClaimsPrincipal
    Microsoft.AspNetCore.Mvc.ViewComponent.RouteData
    Microsoft.AspNetCore.Mvc.ViewComponent.ViewBag
    Microsoft.AspNetCore.Mvc.ViewComponent.ModelState
    Microsoft.AspNetCore.Mvc.ViewComponent.Url
    Microsoft.AspNetCore.Mvc.ViewComponent.ViewComponentContext
    Microsoft.AspNetCore.Mvc.ViewComponent.ViewContext
    Microsoft.AspNetCore.Mvc.ViewComponent.ViewData
    Microsoft.AspNetCore.Mvc.ViewComponent.TempData
    Microsoft.AspNetCore.Mvc.ViewComponent.ViewEngine
    Examples
    X

    Components/Car/CarBlock.cs

    CarBlock : BlockData { }

    Components/Car/Index.cshtml

    @model object
    Hello world from Car Index.cshtml
    options.DefaultComponentPathPredicate = (Type blockType) =>
    {
        // Can return any path (folder), and also vary based on the Type if you want
        return "~/Components/";
    };

    CarBlock will use the Default Component Path Predicate, and return "~/Components/" as the root folder This means that Car/Index.cshtml will be found inside the /Components/ folder, and the view is rendered with the Car data Both Index.cshtml and Car.cshtml file name conventions for the view would work out of the box

    Arguments
    X

    Methods

    View Source

    protected override async Task<IViewComponentResult> InvokeComponentAsync(BlockData currentBlock)

    X
    Methods arguments
    Type Name Description
    EPiServer.Core.BlockData currentBlock
    X
    Type Description
    Task<Microsoft.AspNetCore.Mvc.IViewComponentResult>
    Overrides
    EPiServer.Web.Mvc.AsyncPartialContentComponent<EPiServer.Core.BlockData>.InvokeComponentAsync(EPiServer.Core.BlockData)

    Implements

    EPiServer.Web.IRenderTemplate<TModel>
    EPiServer.Web.IRenderTemplate

    Extension Methods

    TExtensions.ReactServerSideRender<T>(T, Object, String, Boolean, String, String, String, Boolean, Boolean, Boolean)

    }

    • View Source
    In This Article
    Package: nuget
    Source: github
    Website: [%footerSiteTitle%]