Share via


TagHelperOutput Class

Definition

Class used to represent the output of an ITagHelper.

public ref class TagHelperOutput : Microsoft::AspNetCore::Html::IHtmlContentContainer
public class TagHelperOutput : Microsoft.AspNetCore.Html.IHtmlContentContainer
type TagHelperOutput = class
    interface IHtmlContentContainer
    interface IHtmlContent
type TagHelperOutput = class
    interface IHtmlContent
    interface IHtmlContentContainer
Public Class TagHelperOutput
Implements IHtmlContentContainer
Inheritance
TagHelperOutput
Implements

Constructors

TagHelperOutput(String, TagHelperAttributeList, Func<Boolean,HtmlEncoder,Task<TagHelperContent>>)

Instantiates a new instance of TagHelperOutput.

Properties

Attributes

The HTML element's attributes.

Content

Get or set the HTML element's main content.

IsContentModified

true if Content has been set, false otherwise.

PostContent

The HTML element's post content.

PostElement

Content that follows the HTML element.

PreContent

The HTML element's pre content.

PreElement

Content that precedes the HTML element.

TagMode

Syntax of the element in the generated HTML.

TagName

The HTML element's tag name.

Methods

GetChildContentAsync()

Executes children asynchronously and returns their rendered content.

GetChildContentAsync(Boolean, HtmlEncoder)

Executes children asynchronously with the given encoder in scope and returns their rendered content.

GetChildContentAsync(Boolean)

Executes children asynchronously and returns their rendered content.

GetChildContentAsync(HtmlEncoder)

Executes children asynchronously with the given encoder in scope and returns their rendered content.

Reinitialize(String, TagMode)

Clears the TagHelperOutput and updates its state with the provided values.

SuppressOutput()

Changes TagHelperOutput to generate nothing.

WriteTo(TextWriter, HtmlEncoder)

Writes the content by encoding it with the specified encoder to the specified writer.

Explicit Interface Implementations

IHtmlContentContainer.CopyTo(IHtmlContentBuilder)
IHtmlContentContainer.MoveTo(IHtmlContentBuilder)

Extension Methods

AddClass(TagHelperOutput, String, HtmlEncoder)

Adds the given classValue to the tagHelperOutput's Attributes.

CopyHtmlAttribute(TagHelperOutput, String, TagHelperContext)

Copies a user-provided attribute from context's AllAttributes to tagHelperOutput's Attributes.

MergeAttributes(TagHelperOutput, TagBuilder)

Merges the given tagBuilder's Attributes into the tagHelperOutput.

RemoveClass(TagHelperOutput, String, HtmlEncoder)

Removes the given classValue from the tagHelperOutput's Attributes.

RemoveRange(TagHelperOutput, IEnumerable<TagHelperAttribute>)

Removes the given attributes from tagHelperOutput's Attributes.

Applies to