Class PartialViewComponentRenderer
- Namespace
- Sitecore.AspNetCore.SDK.RenderingEngine.Rendering
- Assembly
- Sitecore.AspNetCore.SDK.RenderingEngine.dll
An IComponentRenderer that will render Partial Views.
public class PartialViewComponentRenderer : IComponentRenderer
- Inheritance
-
PartialViewComponentRenderer
- Implements
- Inherited Members
Constructors
PartialViewComponentRenderer(string)
Initializes a new instance of the PartialViewComponentRenderer class.
public PartialViewComponentRenderer(string locator)
Parameters
locator
stringThe string to use when locating the Partial View.
Methods
Describe(Predicate<string>, string)
Creates an instance of a ComponentRendererDescriptor for the PartialViewComponentRenderer class.
public static ComponentRendererDescriptor Describe(Predicate<string> match, string locator)
Parameters
match
Predicate<string>A predicate to use when attempting to match a layout component.
locator
stringThe string to use when locating the Partial View.
Returns
- ComponentRendererDescriptor
An instance of ComponentRendererDescriptor that describes the PartialViewComponentRenderer.
Render(ISitecoreRenderingContext, ViewContext)
Generates the output HTML.
public Task<IHtmlContent> Render(ISitecoreRenderingContext renderingContext, ViewContext viewContext)
Parameters
renderingContext
ISitecoreRenderingContextThe current ISitecoreRenderingContext.
viewContext
ViewContextThe current ViewContext.
Returns
- Task<IHtmlContent>
The HTML content to render.