Class ModelBoundViewComponentComponentRenderer
Version: 21.x
An IComponentRenderer that will render View Components that are bound to a specified Model type.
Inheritance
System.Object
ModelBoundViewComponentComponentRenderer
Implements
Namespace: Sitecore.AspNet.RenderingEngine.Rendering
Assembly: Sitecore.AspNet.RenderingEngine.dll
Syntax
Type Parameters
| Name | Description |
|---|---|
| TModel | The model type to bind to the View Component. |
Constructors
ModelBoundViewComponentComponentRenderer(String, String)
Initializes a new instance of the ModelBoundViewComponentComponentRenderer
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | locator | The string to use when locating the View Component. |
| System.String | viewName | The name of the view to use when rendering. |
Methods
Render(ISitecoreRenderingContext, ViewContext)
Generates the output HTML.
Declaration
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
If you have suggestions for improving this article, let us know!