PartialTagHelper Class

Definition

Renders a partial view.

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

Constructors

PartialTagHelper(ICompositeViewEngine, IViewBufferScope)

Creates a new PartialTagHelper.

PartialTagHelper(ICompositeViewEngine, IViewBufferScope)

Properties

FallbackName

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

For

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

Model

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

Name

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

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

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

Gets the ViewContext of the executing view.

ViewData

A ViewDataDictionary to pass into the partial view.

Methods

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)

Synchronously executes the TagHelper with the given context and output.

(Inherited from TagHelper)
ProcessAsync(TagHelperContext, TagHelperOutput)

Asynchronously executes the TagHelper with the given context and output.

Applies to