ViewComponentHelperExtensions Class

Extension methods for Microsoft.AspNetCore.Mvc.IViewComponentHelper.

Namespace
Microsoft.AspNetCore.Mvc.Rendering
Assemblies
  • Microsoft.AspNetCore.Mvc.ViewFeatures

Syntax

public class ViewComponentHelperExtensions
class Microsoft.AspNetCore.Mvc.Rendering.ViewComponentHelperExtensions

Methods

InvokeAsync(Microsoft.AspNetCore.Mvc.IViewComponentHelper, System.String)

Invokes a view component with the specified <em>name</em>.

Arguments:
Return type:

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

Returns:

A System.Threading.Tasks.Task that on completion returns the rendered Microsoft.AspNetCore.Html.IHtmlContent.

public static Task<IHtmlContent> InvokeAsync(this IViewComponentHelper helper, string name)
InvokeAsync(Microsoft.AspNetCore.Mvc.IViewComponentHelper, System.Type)

Invokes a view component of type <em>componentType</em>.

Arguments:
Return type:

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

Returns:

A System.Threading.Tasks.Task that on completion returns the rendered Microsoft.AspNetCore.Html.IHtmlContent.

public static Task<IHtmlContent> InvokeAsync(this IViewComponentHelper helper, Type componentType)
InvokeAsync<TComponent>(Microsoft.AspNetCore.Mvc.IViewComponentHelper)

Invokes a view component of type <em>TComponent</em>.

Arguments:helper (Microsoft.AspNetCore.Mvc.IViewComponentHelper) – The Microsoft.AspNetCore.Mvc.IViewComponentHelper.
Return type:System.Threading.Tasks.Task<Microsoft.AspNetCore.Html.IHtmlContent>
Returns:A System.Threading.Tasks.Task that on completion returns the rendered Microsoft.AspNetCore.Html.IHtmlContent.
public static Task<IHtmlContent> InvokeAsync<TComponent>(this IViewComponentHelper helper)
InvokeAsync<TComponent>(Microsoft.AspNetCore.Mvc.IViewComponentHelper, System.Object)

Invokes a view component of type <em>TComponent</em>.

Arguments:
Return type:

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

Returns:

A System.Threading.Tasks.Task that on completion returns the rendered Microsoft.AspNetCore.Html.IHtmlContent.

public static Task<IHtmlContent> InvokeAsync<TComponent>(this IViewComponentHelper helper, object arguments)