HtmlTextWriter.SelfClosingTagEnd 欄位
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
表示自我結尾標記項目的結尾斜線符號和右角括弧 (/>)。
public: System::String ^ SelfClosingTagEnd;
C#
public const string SelfClosingTagEnd;
val mutable SelfClosingTagEnd : string
Public Const SelfClosingTagEnd As String
下列程式碼範例示範如何轉譯自訂 FileName
屬性的值,後面接著引號和欄位所代表的 SelfClosingTagEnd 字元。 程式碼範例會呼叫 方法, Write 並將 欄位當做參數引數傳遞 SelfClosingTagEnd ,以關閉 專案。
此程式碼範例會 FileName
轉譯 屬性值,然後轉譯下列標記:
" />
C#
// 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 會使用 欄位。
產品 | 版本 |
---|---|
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |