TagHelperOutput 类

定义

用于表示 的输出的 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
继承
TagHelperOutput
实现

构造函数

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

实例化 TagHelperOutput 的新实例。

属性

Attributes

HTML 元素的属性。

Content

获取或设置 HTML 元素的main内容。

IsContentModified

true 如果 Content 已设置,则为 ; false 否则为 。

PostContent

HTML 元素的帖子内容。

PostElement

HTML 元素后面的内容。

PreContent

HTML 元素的预内容。

PreElement

HTML 元素之前的内容。

TagMode

生成的 HTML 中元素的语法。

TagName

HTML 元素的标记名称。

方法

GetChildContentAsync()

异步执行子级并返回其呈现的内容。

GetChildContentAsync(Boolean)

异步执行子级并返回其呈现的内容。

GetChildContentAsync(Boolean, HtmlEncoder)

使用范围内给定 encoder 的 异步执行子级,并返回其呈现的内容。

GetChildContentAsync(HtmlEncoder)

使用范围内给定 encoder 的 异步执行子级,并返回其呈现的内容。

Reinitialize(String, TagMode)

清除 并使用 TagHelperOutput 提供的值更新其状态。

SuppressOutput()

更改 TagHelperOutput 以不生成任何内容。

WriteTo(TextWriter, HtmlEncoder)

通过使用指定的 encoder 将内容编码为指定的 writer来写入内容。

显式接口实现

IHtmlContentContainer.CopyTo(IHtmlContentBuilder)

用于表示 的输出的 ITagHelper类。

IHtmlContentContainer.MoveTo(IHtmlContentBuilder)

用于表示 的输出的 ITagHelper类。

扩展方法

AddClass(TagHelperOutput, String, HtmlEncoder)

将给定 classValue 的 添加到 tagHelperOutputAttributes

CopyHtmlAttribute(TagHelperOutput, String, TagHelperContext)

将用户提供的属性从 contextAllAttributes 复制到 tagHelperOutputAttributes

MergeAttributes(TagHelperOutput, TagBuilder)

将给定 tagBuilder的 合并 Attributes 到 中 tagHelperOutput

RemoveClass(TagHelperOutput, String, HtmlEncoder)

tagHelperOutput的 中移除给定classValueAttributes

RemoveRange(TagHelperOutput, IEnumerable<TagHelperAttribute>)

从 的 中移除给定attributestagHelperOutputAttributes

适用于