HtmlHelperPartialExtensions Class

Summary

PartialView-related extensions for [Microsoft.AspNet.Mvc.Rendering.IHtmlHelper](Microsoft.AspNet.Mvc.Rendering.IHtmlHelper.yml).

Syntax

public class HtmlHelperPartialExtensions

GitHub

View on GitHub

class Microsoft.AspNet.Mvc.Rendering.HtmlHelperPartialExtensions

Methods

Partial(Microsoft.AspNet.Mvc.Rendering.IHtmlHelper, System.String)

Returns HTML markup for the specified partial view.

Arguments:
  • htmlHelper (Microsoft.AspNet.Mvc.Rendering.IHtmlHelper) – The [Microsoft.AspNet.Mvc.Rendering.IHtmlHelper](Microsoft.AspNet.Mvc.Rendering.IHtmlHelper.yml) instance this method extends.
  • partialViewName (System.String) – The name of the partial view used to create the HTML markup. Must not be <c>null</c>.
Return type:

Microsoft.AspNet.Mvc.Rendering.HtmlString

Returns:

Returns a new [Microsoft.AspNet.Mvc.Rendering.HtmlString](Microsoft.AspNet.Mvc.Rendering.HtmlString.yml) containing the created HTML.

public static HtmlString Partial(IHtmlHelper htmlHelper, string partialViewName)
Partial(Microsoft.AspNet.Mvc.Rendering.IHtmlHelper, System.String, Microsoft.AspNet.Mvc.ViewDataDictionary)

Returns HTML markup for the specified partial view.

Arguments:
  • htmlHelper (Microsoft.AspNet.Mvc.Rendering.IHtmlHelper) – The [Microsoft.AspNet.Mvc.Rendering.IHtmlHelper](Microsoft.AspNet.Mvc.Rendering.IHtmlHelper.yml) instance this method extends.
  • partialViewName (System.String) – The name of the partial view used to create the HTML markup. Must not be <c>null</c>.
  • viewData (Microsoft.AspNet.Mvc.ViewDataDictionary) – A [Microsoft.AspNet.Mvc.ViewDataDictionary](Microsoft.AspNet.Mvc.ViewDataDictionary.yml) to pass into the partial view.
Return type:

Microsoft.AspNet.Mvc.Rendering.HtmlString

Returns:

Returns a new [Microsoft.AspNet.Mvc.Rendering.HtmlString](Microsoft.AspNet.Mvc.Rendering.HtmlString.yml) containing the created HTML.

public static HtmlString Partial(IHtmlHelper htmlHelper, string partialViewName, ViewDataDictionary viewData)
Partial(Microsoft.AspNet.Mvc.Rendering.IHtmlHelper, System.String, System.Object)

Returns HTML markup for the specified partial view.

Arguments:
  • htmlHelper (Microsoft.AspNet.Mvc.Rendering.IHtmlHelper) – The [Microsoft.AspNet.Mvc.Rendering.IHtmlHelper](Microsoft.AspNet.Mvc.Rendering.IHtmlHelper.yml) instance this method extends.
  • partialViewName (System.String) – The name of the partial view used to create the HTML markup. Must not be <c>null</c>.
  • model (System.Object) – A model to pass into the partial view.
Return type:

Microsoft.AspNet.Mvc.Rendering.HtmlString

Returns:

Returns a new [Microsoft.AspNet.Mvc.Rendering.HtmlString](Microsoft.AspNet.Mvc.Rendering.HtmlString.yml) containing the created HTML.

public static HtmlString Partial(IHtmlHelper htmlHelper, string partialViewName, object model)
Partial(Microsoft.AspNet.Mvc.Rendering.IHtmlHelper, System.String, System.Object, Microsoft.AspNet.Mvc.ViewDataDictionary)

Returns HTML markup for the specified partial view.

Arguments:
  • htmlHelper (Microsoft.AspNet.Mvc.Rendering.IHtmlHelper) –
  • partialViewName (System.String) – The name of the partial view used to create the HTML markup. Must not be <c>null</c>.
  • model (System.Object) – A model to pass into the partial view.
  • viewData (Microsoft.AspNet.Mvc.ViewDataDictionary) – A [Microsoft.AspNet.Mvc.ViewDataDictionary](Microsoft.AspNet.Mvc.ViewDataDictionary.yml) to pass into the partial view.
Return type:

Microsoft.AspNet.Mvc.Rendering.HtmlString

Returns:

Returns a new [Microsoft.AspNet.Mvc.Rendering.HtmlString](Microsoft.AspNet.Mvc.Rendering.HtmlString.yml) containing the created HTML.

public static HtmlString Partial(IHtmlHelper htmlHelper, string partialViewName, object model, ViewDataDictionary viewData)
PartialAsync(Microsoft.AspNet.Mvc.Rendering.IHtmlHelper, System.String)

Returns HTML markup for the specified partial view.

Arguments:
  • htmlHelper (Microsoft.AspNet.Mvc.Rendering.IHtmlHelper) – The [Microsoft.AspNet.Mvc.Rendering.IHtmlHelper](Microsoft.AspNet.Mvc.Rendering.IHtmlHelper.yml) instance this method extends.
  • partialViewName (System.String) – The name of the partial view used to create the HTML markup. Must not be <c>null</c>.
Return type:

System.Threading.Tasks.Task{Microsoft.AspNet.Mvc.Rendering.HtmlString}

Returns:

A [System.Threading.Tasks.Task]() that on completion returns a new [Microsoft.AspNet.Mvc.Rendering.HtmlString](Microsoft.AspNet.Mvc.Rendering.HtmlString.yml) containing the created HTML.

public static Task<HtmlString> PartialAsync(IHtmlHelper htmlHelper, string partialViewName)
PartialAsync(Microsoft.AspNet.Mvc.Rendering.IHtmlHelper, System.String, Microsoft.AspNet.Mvc.ViewDataDictionary)

Returns HTML markup for the specified partial view.

Arguments:
  • htmlHelper (Microsoft.AspNet.Mvc.Rendering.IHtmlHelper) – The [Microsoft.AspNet.Mvc.Rendering.IHtmlHelper](Microsoft.AspNet.Mvc.Rendering.IHtmlHelper.yml) instance this method extends.
  • partialViewName (System.String) – The name of the partial view used to create the HTML markup. Must not be <c>null</c>.
  • viewData (Microsoft.AspNet.Mvc.ViewDataDictionary) – A [Microsoft.AspNet.Mvc.ViewDataDictionary](Microsoft.AspNet.Mvc.ViewDataDictionary.yml) to pass into the partial view.
Return type:

System.Threading.Tasks.Task{Microsoft.AspNet.Mvc.Rendering.HtmlString}

Returns:

A [System.Threading.Tasks.Task]() that on completion returns a new [Microsoft.AspNet.Mvc.Rendering.HtmlString](Microsoft.AspNet.Mvc.Rendering.HtmlString.yml) containing the created HTML.

public static Task<HtmlString> PartialAsync(IHtmlHelper htmlHelper, string partialViewName, ViewDataDictionary viewData)
PartialAsync(Microsoft.AspNet.Mvc.Rendering.IHtmlHelper, System.String, System.Object)

Returns HTML markup for the specified partial view.

Arguments:
  • htmlHelper (Microsoft.AspNet.Mvc.Rendering.IHtmlHelper) – The [Microsoft.AspNet.Mvc.Rendering.IHtmlHelper](Microsoft.AspNet.Mvc.Rendering.IHtmlHelper.yml) instance this method extends.
  • partialViewName (System.String) – The name of the partial view used to create the HTML markup. Must not be <c>null</c>.
  • model (System.Object) – A model to pass into the partial view.
Return type:

System.Threading.Tasks.Task{Microsoft.AspNet.Mvc.Rendering.HtmlString}

Returns:

A [System.Threading.Tasks.Task]() that on completion returns a new [Microsoft.AspNet.Mvc.Rendering.HtmlString](Microsoft.AspNet.Mvc.Rendering.HtmlString.yml) containing the created HTML.

public static Task<HtmlString> PartialAsync(IHtmlHelper htmlHelper, string partialViewName, object model)
RenderPartialAsync(Microsoft.AspNet.Mvc.Rendering.IHtmlHelper, System.String)

Renders HTML markup for the specified partial view.

Arguments:
  • htmlHelper (Microsoft.AspNet.Mvc.Rendering.IHtmlHelper) – The [Microsoft.AspNet.Mvc.Rendering.IHtmlHelper](Microsoft.AspNet.Mvc.Rendering.IHtmlHelper.yml) instance this method extends.
  • partialViewName (System.String) – The name of the partial view used to create the HTML markup. Must not be <c>null</c>.
Return type:

System.Threading.Tasks.Task

Returns:

A [System.Threading.Tasks.Task]() that renders the created HTML when it executes.

public static Task RenderPartialAsync(IHtmlHelper htmlHelper, string partialViewName)
RenderPartialAsync(Microsoft.AspNet.Mvc.Rendering.IHtmlHelper, System.String, Microsoft.AspNet.Mvc.ViewDataDictionary)

Renders HTML markup for the specified partial view.

Arguments:
  • htmlHelper (Microsoft.AspNet.Mvc.Rendering.IHtmlHelper) – The [Microsoft.AspNet.Mvc.Rendering.IHtmlHelper](Microsoft.AspNet.Mvc.Rendering.IHtmlHelper.yml) instance this method extends.
  • partialViewName (System.String) – The name of the partial view used to create the HTML markup. Must not be <c>null</c>.
  • viewData (Microsoft.AspNet.Mvc.ViewDataDictionary) – A [Microsoft.AspNet.Mvc.ViewDataDictionary](Microsoft.AspNet.Mvc.ViewDataDictionary.yml) to pass into the partial view.
Return type:

System.Threading.Tasks.Task

Returns:

A [System.Threading.Tasks.Task]() that renders the created HTML when it executes.

public static Task RenderPartialAsync(IHtmlHelper htmlHelper, string partialViewName, ViewDataDictionary viewData)
RenderPartialAsync(Microsoft.AspNet.Mvc.Rendering.IHtmlHelper, System.String, System.Object)

Renders HTML markup for the specified partial view.

Arguments:
  • htmlHelper (Microsoft.AspNet.Mvc.Rendering.IHtmlHelper) – The [Microsoft.AspNet.Mvc.Rendering.IHtmlHelper](Microsoft.AspNet.Mvc.Rendering.IHtmlHelper.yml) instance this method extends.
  • partialViewName (System.String) – The name of the partial view used to create the HTML markup. Must not be <c>null</c>.
  • model (System.Object) – A model to pass into the partial view.
Return type:

System.Threading.Tasks.Task

Returns:

A [System.Threading.Tasks.Task]() that renders the created HTML when it executes.

public static Task RenderPartialAsync(IHtmlHelper htmlHelper, string partialViewName, object model)