IViewComponentHelper Interface¶
Supports the rendering of view components in a view.
- Namespace
Microsoft.AspNetCore.Mvc- Assemblies
- Microsoft.AspNetCore.Mvc.ViewFeatures
Syntax¶
public interface IViewComponentHelper
-
interface
Microsoft.AspNetCore.Mvc.IViewComponentHelper
Methods¶
-
InvokeAsync(System.String, System.Object)¶ Invokes a view component with the specified <em>name</em>.
Arguments: - name (System.String) – The name of the view component.
- arguments (System.Object) – An
System.Objectwith properties representing arguments to be passed to the invoked view component method. Alternatively, anSystem.Collections.Generic.IDictionary`2instance containing the invocation arguments.
Return type: System.Threading.Tasks.Task<Microsoft.AspNetCore.Html.IHtmlContent>
Returns: A
System.Threading.Tasks.Taskthat on completion returns the renderedMicrosoft.AspNetCore.Html.IHtmlContent.Task<IHtmlContent> InvokeAsync(string name, object arguments)
-
InvokeAsync(System.Type, System.Object) Invokes a view component of type <em>componentType</em>.
Arguments: - componentType (System.Type) – The view component
System.Type. - arguments (System.Object) – An
System.Objectwith properties representing arguments to be passed to the invoked view component method. Alternatively, anSystem.Collections.Generic.IDictionary`2instance containing the invocation arguments.
Return type: System.Threading.Tasks.Task<Microsoft.AspNetCore.Html.IHtmlContent>
Returns: A
System.Threading.Tasks.Taskthat on completion returns the renderedMicrosoft.AspNetCore.Html.IHtmlContent.Task<IHtmlContent> InvokeAsync(Type componentType, object arguments)
- componentType (System.Type) – The view component
-