Class PartialViewComponentRenderer

Version: 21.x

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(String)

Initializes a new instance of the PartialViewComponentRenderer class.

Declaration
public PartialViewComponentRenderer(string locator)
Parameters
TypeNameDescription
System.StringlocatorThe string to use when locating the Partial View.

Methods

Describe(Predicate, String)

Creates an instance of a ComponentRendererDescriptor for the PartialViewComponentRenderer class.

Declaration
public static ComponentRendererDescriptor Describe(Predicate<string> match, string locator)
Parameters
TypeNameDescription
System.Predicate

<

System.String

>
matchA predicate to use when attempting to match a layout component.
System.StringlocatorThe string to use when locating the Partial View.
Returns
TypeDescription
ComponentRendererDescriptorAn instance of ComponentRendererDescriptor that describes the PartialViewComponentRenderer.

Render(ISitecoreRenderingContext, ViewContext)

Generates the output HTML.

Declaration
public Task<IHtmlContent> Render(ISitecoreRenderingContext renderingContext, ViewContext viewContext)
Parameters
TypeNameDescription
ISitecoreRenderingContextrenderingContextThe current ISitecoreRenderingContext.
Microsoft.AspNetCore.Mvc.Rendering.ViewContextviewContextThe current Microsoft.AspNetCore.Mvc.Rendering.ViewContext.
Returns
TypeDescription
System.Threading.Tasks.Task

<

Microsoft.AspNetCore.Html.IHtmlContent

>
The HTML content to render.

Implements

IComponentRenderer

If you have suggestions for improving this article, let us know!