HtmlHelperPartialExtensions.PartialAsync Method

Definition

Overloads

PartialAsync(IHtmlHelper, String)

Returns HTML markup for the specified partial view.

PartialAsync(IHtmlHelper, String, ViewDataDictionary)

Returns HTML markup for the specified partial view.

PartialAsync(IHtmlHelper, String, Object)

Returns HTML markup for the specified partial view.

PartialAsync(IHtmlHelper, String)

Source:
HtmlHelperPartialExtensions.cs
Source:
HtmlHelperPartialExtensions.cs
Source:
HtmlHelperPartialExtensions.cs

Returns HTML markup for the specified partial view.

C#
public static System.Threading.Tasks.Task<Microsoft.AspNetCore.Html.IHtmlContent> PartialAsync (this Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper htmlHelper, string partialViewName);

Parameters

htmlHelper
IHtmlHelper

The IHtmlHelper instance this method extends.

partialViewName
String

The name or path of the partial view used to create the HTML markup. Must not be null.

Returns

A Task that on completion returns a new IHtmlContent instance containing the created HTML.

Applies to

ASP.NET Core 9.0 and other versions
Product Versions
ASP.NET Core 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

PartialAsync(IHtmlHelper, String, ViewDataDictionary)

Source:
HtmlHelperPartialExtensions.cs
Source:
HtmlHelperPartialExtensions.cs
Source:
HtmlHelperPartialExtensions.cs

Returns HTML markup for the specified partial view.

C#
public static System.Threading.Tasks.Task<Microsoft.AspNetCore.Html.IHtmlContent> PartialAsync (this Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper htmlHelper, string partialViewName, Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary viewData);

Parameters

htmlHelper
IHtmlHelper

The IHtmlHelper instance this method extends.

partialViewName
String

The name or path of the partial view used to create the HTML markup. Must not be null.

viewData
ViewDataDictionary

A ViewDataDictionary to pass into the partial view.

Returns

A Task that on completion returns a new IHtmlContent instance containing the created HTML.

Applies to

ASP.NET Core 9.0 and other versions
Product Versions
ASP.NET Core 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

PartialAsync(IHtmlHelper, String, Object)

Source:
HtmlHelperPartialExtensions.cs
Source:
HtmlHelperPartialExtensions.cs
Source:
HtmlHelperPartialExtensions.cs

Returns HTML markup for the specified partial view.

C#
public static System.Threading.Tasks.Task<Microsoft.AspNetCore.Html.IHtmlContent> PartialAsync (this Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper htmlHelper, string partialViewName, object model);

Parameters

htmlHelper
IHtmlHelper

The IHtmlHelper instance this method extends.

partialViewName
String

The name or path of the partial view used to create the HTML markup. Must not be null.

model
Object

A model to pass into the partial view.

Returns

A Task that on completion returns a new IHtmlContent instance containing the created HTML.

Applies to

ASP.NET Core 9.0 and other versions
Product Versions
ASP.NET Core 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0