HtmlTextWriter.SelfClosingTagEnd 字段

定义

表示自结束标记元素的右斜杠标记和右尖括号 (/>)。Represents the closing slash mark and right angle bracket (/>) of a self-closing markup element.

public: System::String ^ SelfClosingTagEnd;
public const string SelfClosingTagEnd;
val mutable SelfClosingTagEnd : string
Public Const SelfClosingTagEnd As String 

字段值

示例

下面的代码示例演示如何呈现自定义FileName属性的值,后跟一个引号和SelfClosingTagEnd字段所表示的字符。The following code example shows how to render the value of a custom FileName property followed by a quotation mark and the characters represented by the SelfClosingTagEnd field. 此代码示例调用Write方法并将SelfClosingTagEnd字段作为参数参数传递,以关闭元素。The code example calls the Write method and passes the SelfClosingTagEnd field as the parameter argument to close the element.

此代码示例将呈现FileName属性值,然后显示以下标记:This code example renders the FileName property value, and then the following markup:

" />

// Write the name of the image file from the 
// FileName property, close the path, and then
// close the <img> element.
writer.Write(FileName);
writer.Write(HtmlTextWriter.DoubleQuoteChar);
writer.Write(HtmlTextWriter.SelfClosingTagEnd);
' Write the name of the image file from the 
' FileName property, close the path, and then
' close the <img> element.
writer.Write(FileName)
writer.Write(HtmlTextWriter.DoubleQuoteChar)
writer.Write(HtmlTextWriter.SelfClosingTagEnd)

注解

构造自结束标记元素时RenderBeginTag ,方法使用字段。SelfClosingTagEndThe SelfClosingTagEnd field is used by the RenderBeginTag method when constructing self-closing markup elements.

适用于

另请参阅