Class SitecoreComponentViewComponent

Version: 21.x

Default view with model binding to render components.

Inheritance

System.Object

BindingViewComponent

SitecoreComponentViewComponent

Inherited Members

BindingViewComponent.BindView()

BindingViewComponent.BindView(TModel)

BindingViewComponent.BindView(String)

BindingViewComponent.BindView(String, TModel)

BindingViewComponent.BindView(Type, String)

BindingViewComponent.Binder

Namespace: Sitecore.AspNet.RenderingEngine.ViewComponents

Assembly: Sitecore.AspNet.RenderingEngine.dll
Syntax
public class SitecoreComponentViewComponent : BindingViewComponent

Constructors

SitecoreComponentViewComponent(IViewModelBinder)

Initializes a new instance of the SitecoreComponentViewComponent class.

Declaration
public SitecoreComponentViewComponent(IViewModelBinder binder)
Parameters
TypeNameDescription
IViewModelBinderbinderThe IViewModelBinder to use when binding the model to the view component.

Methods

InvokeAsync(Type, String)

Executes the view component.

Declaration
public Task<IViewComponentResult> InvokeAsync(Type modelType, string viewName)
Parameters
TypeNameDescription
System.TypemodelTypeThe type of the model to use when generating the view component output.
System.StringviewNameThe name of the view to use when generating the view component output.
Returns
TypeDescription
System.Threading.Tasks.Task

<

Microsoft.AspNetCore.Mvc.IViewComponentResult

>
A System.Threading.Tasks.Task<> representing the result of the asynchronous operation.
If you have suggestions for improving this article, let us know!