HtmlTextWriter.RenderEndTag HtmlTextWriter.RenderEndTag HtmlTextWriter.RenderEndTag HtmlTextWriter.RenderEndTag Method

定義

將標記項目的結尾標記寫入輸出資料流中。Writes the end tag of a markup element to the output stream.

public:
 virtual void RenderEndTag();
public virtual void RenderEndTag ();
abstract member RenderEndTag : unit -> unit
override this.RenderEndTag : unit -> unit
Public Overridable Sub RenderEndTag ()

範例

下列程式碼範例示範如何在RenderEndTag RenderBeginTag產生開頭標記的方法,以及Write在自訂的開頭和結束記號之間呈現內部標記的方法,呼叫方法。MyTag已呼叫元素。The following code example demonstrates how to call the RenderEndTag method after both the RenderBeginTag method that generates the opening tag and the Write method that renders the inner markup between the opening and closing tags of the custom MyTag element have been called.

這個程式碼範例會產生下列標記:This code example generates the following markup:

<MyTag>

Contents of MyTag

</MyTag>

// Create a non-standard tag.
writer->RenderBeginTag( "MyTag" );
writer->Write( "Contents of MyTag" );
writer->RenderEndTag();
writer->WriteLine();
// Create a non-standard tag.
writer.RenderBeginTag("MyTag");
writer.Write("Contents of MyTag");
writer.RenderEndTag();
writer.WriteLine();
' Create a non-standard tag.
writer.RenderBeginTag("MyTag")
writer.Write("Contents of MyTag")
writer.RenderEndTag()
writer.WriteLine()

備註

在呼叫多載RenderBeginTag之後,以及專案開頭和結束記號(內部標記)之間的所有內容都已轉譯之後,呼叫方法。RenderEndTagCall the RenderEndTag method after the RenderBeginTag overload is called and after all content between the opening and closing tags (inner markup) of the element has been rendered.

適用於

另請參閱