HtmlTextWriter.SelfClosingTagEnd 欄位

定義

表示自我結尾標記項目的結尾斜線符號和右角括弧 (/>)。

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

欄位值

範例

下列程式碼範例示範如何轉譯自訂 FileName 屬性的值,後面接著引號和欄位所代表的 SelfClosingTagEnd 字元。 程式碼範例會呼叫 方法, Write 並將 欄位當做參數引數傳遞 SelfClosingTagEnd ,以關閉 專案。

此程式碼範例會 FileName 轉譯 屬性值,然後轉譯下列標記:

" />

// 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 方法 SelfClosingTagEnd 會使用 欄位。

適用於

另請參閱