PartialTagHelper PartialTagHelper PartialTagHelper Class


Renders a partial view.

[Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("partial", Attributes="name", TagStructure=Microsoft.AspNetCore.Razor.TagHelpers.TagStructure.WithoutEndTag)]
public class PartialTagHelper : Microsoft.AspNetCore.Razor.TagHelpers.TagHelper
type PartialTagHelper = class
    inherit TagHelper
Public Class PartialTagHelper
Inherits TagHelper


PartialTagHelper(ICompositeViewEngine, IViewBufferScope) PartialTagHelper(ICompositeViewEngine, IViewBufferScope) PartialTagHelper(ICompositeViewEngine, IViewBufferScope)


FallbackName FallbackName FallbackName

View to lookup if the view specified by Name cannot be located.

For For For

An expression to be evaluated against the current model. Cannot be used together with Model.

Model Model Model

The model to pass into the partial view. Cannot be used together with For.

Name Name Name

The name or path of the partial view that is rendered to the response.

Optional Optional Optional

When optional, executing the tag helper will no-op if the view cannot be located. Otherwise will throw stating the view could not be found.

Order Order Order

When a set of ITagHelpers are executed, their Init(TagHelperContext)'s are first invoked in the specified Order; then their ProcessAsync(TagHelperContext, TagHelperOutput)'s are invoked in the specified Order. Lower values are executed first.

(Inherited from TagHelper)
ViewContext ViewContext ViewContext
ViewData ViewData ViewData

A ViewDataDictionary to pass into the partial view.


Init(TagHelperContext) Init(TagHelperContext) Init(TagHelperContext)

Initializes the ITagHelper with the given context. Additions to Items should be done within this method to ensure they're added prior to executing the children.

(Inherited from TagHelper)
Process(TagHelperContext, TagHelperOutput) Process(TagHelperContext, TagHelperOutput) Process(TagHelperContext, TagHelperOutput)

Synchronously executes the TagHelper with the given context and output.

(Inherited from TagHelper)
ProcessAsync(TagHelperContext, TagHelperOutput) ProcessAsync(TagHelperContext, TagHelperOutput) ProcessAsync(TagHelperContext, TagHelperOutput)

Applies to