Class PartialViewComponentRenderer

Version: 21.x

An IComponentRenderer that will render Partial Views.

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

Constructors

PartialViewComponentRenderer(String)

Initializes a new instance of the PartialViewComponentRenderer class.

Declaration
RequestResponse
public PartialViewComponentRenderer(string locator)
Parameters
TypeNameDescription
System.Stringlocator

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
RequestResponse
public static ComponentRendererDescriptor Describe(Predicate<string> match, string locator)
Parameters
TypeNameDescription
System.Predicate<System.String>match

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

System.Stringlocator

The string to use when locating the Partial View.

Returns

Render(ISitecoreRenderingContext, ViewContext)

Generates the output HTML.

Declaration
RequestResponse
public Task<IHtmlContent> Render(ISitecoreRenderingContext renderingContext, ViewContext viewContext)
Parameters
TypeNameDescription
ISitecoreRenderingContextrenderingContext

The current ISitecoreRenderingContext.

Microsoft.AspNetCore.Mvc.Rendering.ViewContextviewContext

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

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

The HTML content to render.

Implements

Do you have some feedback for us?

If you have suggestions for improving this article,