HtmlHelperPartialExtensions Class¶
PartialView-related extensions for Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper
.
- Namespace
Microsoft.AspNetCore.Mvc.Rendering
- Assemblies
- Microsoft.AspNetCore.Mvc.ViewFeatures
Syntax¶
public class HtmlHelperPartialExtensions
-
class
Microsoft.AspNetCore.Mvc.Rendering.
HtmlHelperPartialExtensions
Methods¶
-
Partial
(Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper, System.String)¶ Returns HTML markup for the specified partial view.
Arguments: - htmlHelper (Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper) – The
Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper
instance this method extends. - partialViewName (System.String) – The name of the partial view used to create the HTML markup. Must not be <code>null</code>.
Return type: Returns: Returns a new
Microsoft.AspNetCore.Html.IHtmlContent
instance containing the created HTML.public static IHtmlContent Partial(this IHtmlHelper htmlHelper, string partialViewName)
- htmlHelper (Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper) – The
-
Partial
(Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper, System.String, Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary) Returns HTML markup for the specified partial view.
Arguments: - htmlHelper (Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper) – The
Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper
instance this method extends. - partialViewName (System.String) – The name of the partial view used to create the HTML markup. Must not be <code>null</code>.
- viewData (Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary) – A
Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary
to pass into the partial view.
Return type: Returns: Returns a new
Microsoft.AspNetCore.Html.IHtmlContent
instance containing the created HTML.public static IHtmlContent Partial(this IHtmlHelper htmlHelper, string partialViewName, ViewDataDictionary viewData)
- htmlHelper (Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper) – The
-
Partial
(Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper, System.String, System.Object) Returns HTML markup for the specified partial view.
Arguments: - htmlHelper (Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper) – The
Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper
instance this method extends. - partialViewName (System.String) – The name of the partial view used to create the HTML markup. Must not be <code>null</code>.
- model (System.Object) – A model to pass into the partial view.
Return type: Returns: Returns a new
Microsoft.AspNetCore.Html.IHtmlContent
instance containing the created HTML.public static IHtmlContent Partial(this IHtmlHelper htmlHelper, string partialViewName, object model)
- htmlHelper (Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper) – The
-
Partial
(Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper, System.String, System.Object, Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary) Returns HTML markup for the specified partial view.
Arguments: - htmlHelper (Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper) – The
Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper
instance this method extends. - partialViewName (System.String) – The name of the partial view used to create the HTML markup. Must not be <code>null</code>.
- model (System.Object) – A model to pass into the partial view.
- viewData (Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary) – A
Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary
to pass into the partial view.
Return type: Returns: Returns a new
Microsoft.AspNetCore.Html.IHtmlContent
instance containing the created HTML.public static IHtmlContent Partial(this IHtmlHelper htmlHelper, string partialViewName, object model, ViewDataDictionary viewData)
- htmlHelper (Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper) – The
-
PartialAsync
(Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper, System.String)¶ Returns HTML markup for the specified partial view.
Arguments: - htmlHelper (Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper) – The
Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper
instance this method extends. - partialViewName (System.String) – The name of the partial view used to create the HTML markup. Must not be <code>null</code>.
Return type: System.Threading.Tasks.Task<Microsoft.AspNetCore.Html.IHtmlContent>
Returns: A
System.Threading.Tasks.Task
that on completion returns a newMicrosoft.AspNetCore.Html.IHtmlContent
instance containing the created HTML.public static Task<IHtmlContent> PartialAsync(this IHtmlHelper htmlHelper, string partialViewName)
- htmlHelper (Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper) – The
-
PartialAsync
(Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper, System.String, Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary) Returns HTML markup for the specified partial view.
Arguments: - htmlHelper (Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper) – The
Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper
instance this method extends. - partialViewName (System.String) – The name of the partial view used to create the HTML markup. Must not be <code>null</code>.
- viewData (Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary) – A
Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary
to pass into the partial view.
Return type: System.Threading.Tasks.Task<Microsoft.AspNetCore.Html.IHtmlContent>
Returns: A
System.Threading.Tasks.Task
that on completion returns a newMicrosoft.AspNetCore.Html.IHtmlContent
instance containing the created HTML.public static Task<IHtmlContent> PartialAsync(this IHtmlHelper htmlHelper, string partialViewName, ViewDataDictionary viewData)
- htmlHelper (Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper) – The
-
PartialAsync
(Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper, System.String, System.Object) Returns HTML markup for the specified partial view.
Arguments: - htmlHelper (Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper) – The
Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper
instance this method extends. - partialViewName (System.String) – The name of the partial view used to create the HTML markup. Must not be <code>null</code>.
- model (System.Object) – A model to pass into the partial view.
Return type: System.Threading.Tasks.Task<Microsoft.AspNetCore.Html.IHtmlContent>
Returns: A
System.Threading.Tasks.Task
that on completion returns a newMicrosoft.AspNetCore.Html.IHtmlContent
instance containing the created HTML.public static Task<IHtmlContent> PartialAsync(this IHtmlHelper htmlHelper, string partialViewName, object model)
- htmlHelper (Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper) – The
-
RenderPartial
(Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper, System.String)¶ Renders HTML markup for the specified partial view.
Arguments: - htmlHelper (Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper) – The
Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper
instance this method extends. - partialViewName (System.String) – The name of the partial view used to create the HTML markup. Must not be <code>null</code>.
public static void RenderPartial(this IHtmlHelper htmlHelper, string partialViewName)
- htmlHelper (Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper) – The
-
RenderPartial
(Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper, System.String, Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary) Renders HTML markup for the specified partial view.
Arguments: - htmlHelper (Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper) – The
Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper
instance this method extends. - partialViewName (System.String) – The name of the partial view used to create the HTML markup. Must not be <code>null</code>.
- viewData (Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary) – A
Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary
to pass into the partial view.
public static void RenderPartial(this IHtmlHelper htmlHelper, string partialViewName, ViewDataDictionary viewData)
- htmlHelper (Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper) – The
-
RenderPartial
(Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper, System.String, System.Object) Renders HTML markup for the specified partial view.
Arguments: - htmlHelper (Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper) – The
Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper
instance this method extends. - partialViewName (System.String) – The name of the partial view used to create the HTML markup. Must not be <code>null</code>.
- model (System.Object) – A model to pass into the partial view.
public static void RenderPartial(this IHtmlHelper htmlHelper, string partialViewName, object model)
- htmlHelper (Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper) – The
-
RenderPartialAsync
(Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper, System.String)¶ Renders HTML markup for the specified partial view.
Arguments: - htmlHelper (Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper) – The
Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper
instance this method extends. - partialViewName (System.String) – The name of the partial view used to create the HTML markup. Must not be <code>null</code>.
Return type: System.Threading.Tasks.Task
Returns: A
System.Threading.Tasks.Task
that renders the created HTML when it executes.public static Task RenderPartialAsync(this IHtmlHelper htmlHelper, string partialViewName)
- htmlHelper (Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper) – The
-
RenderPartialAsync
(Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper, System.String, Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary) Renders HTML markup for the specified partial view.
Arguments: - htmlHelper (Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper) – The
Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper
instance this method extends. - partialViewName (System.String) – The name of the partial view used to create the HTML markup. Must not be <code>null</code>.
- viewData (Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary) – A
Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary
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(this IHtmlHelper htmlHelper, string partialViewName, ViewDataDictionary viewData)
- htmlHelper (Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper) – The
-
RenderPartialAsync
(Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper, System.String, System.Object) Renders HTML markup for the specified partial view.
Arguments: - htmlHelper (Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper) – The
Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper
instance this method extends. - partialViewName (System.String) – The name of the partial view used to create the HTML markup. Must not be <code>null</code>.
- 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(this IHtmlHelper htmlHelper, string partialViewName, object model)
- htmlHelper (Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper) – The
-