Show / Hide Table of Contents

Class PartialViewComponentRenderer

An IComponentRenderer that will render Partial Views.

Inheritance
System.Object
PartialViewComponentRenderer
Implements
IComponentRenderer
Namespace: Sitecore.AspNet.RenderingEngine.Rendering
Assembly: Sitecore.AspNet.RenderingEngine.dll
Syntax
public class PartialViewComponentRenderer : Object, IComponentRenderer

Constructors

PartialViewComponentRenderer(IHtmlHelper, String)

Initializes a new instance of the PartialViewComponentRenderer class.

Declaration
public PartialViewComponentRenderer(IHtmlHelper htmlHelper, string locator)
Parameters
Type Name Description
Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper htmlHelper

The Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper to use for rendering.

System.String locator

The string to use when locating the Partial View.

Methods

Describe(Predicate<String>, String)

Creates an instance of a ComponentRendererDescriptor for the PartialViewComponentRenderer class.

Declaration
public static ComponentRendererDescriptor Describe(Predicate<string> match, string locator)
Parameters
Type Name Description
System.Predicate<System.String> match

A predicate to use when attempting to match a layout component.

System.String locator

The string to use when locating the Partial View.

Returns
Type Description
ComponentRendererDescriptor

An instance of ComponentRendererDescriptor that describes the PartialViewComponentRenderer.

Render(ISitecoreRenderingContext, ViewContext)

Generates the output HTML.

Declaration
public Task<IHtmlContent> Render(ISitecoreRenderingContext renderingContext, ViewContext viewContext)
Parameters
Type Name Description
ISitecoreRenderingContext renderingContext

The current ISitecoreRenderingContext.

Microsoft.AspNetCore.Mvc.Rendering.ViewContext viewContext

The current Microsoft.AspNetCore.Mvc.Rendering.ViewContext.

Returns
Type Description
System.Threading.Tasks.Task<Microsoft.AspNetCore.Html.IHtmlContent>

The HTML content to render.

Implements

IComponentRenderer
Back to top Generated by DocFX