HtmlTextWriter.SelfClosingTagEnd 欄位
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
代表自閉標記元素的閉鎖斜線和直角括號(/>)。
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)
備註
SelfClosingTagEnd該欄位被方法用於RenderBeginTag構造自閉標記元素。