This documentation is archived and is not being maintained.
HtmlTextWriter.PopEndTag Method
.NET Framework 1.1
Removes an HTML element from the list of rendered elements.
[Visual Basic] Protected Function PopEndTag() As String [C#] protected string PopEndTag(); [C++] protected: String* PopEndTag(); [JScript] protected function PopEndTag() : String;
Return Value
A list of the HTML elements that have been rendered.
Exceptions
| Exception Type | Condition |
|---|---|
| InvalidOperationException | The end tag of the HTML element has not been registered with the page. |
Example
[Visual Basic] Public Overrides Sub RenderEndTag() ' Call the RenderEndTag method of the base class. MyBase.RenderEndTag() ' If the element being rendered is a Label, ' call the PopEndTag method to write its closing tag. If TagKey = HtmlTextWriterTag.Label Then writer.Write(PopEndTag()) End If End Sub 'RenderEndTag End Class 'htwThree [C#] public override void RenderEndTag() { // Call the RenderEndTag method of the base class. base.RenderEndTag(); // If the element being rendered is a <Label>, // call the PopEndTag method to write its closing tag. if(TagKey == HtmlTextWriterTag.Label) { writer.Write(PopEndTag()); } } [C++] public: void RenderEndTag() { // Call the RenderEndTag method of the base class. __super::RenderEndTag(); // If the element being rendered is a <Label>, // call the PopEndTag method to write its closing tag. if (TagKey == HtmlTextWriterTag::Label) { writer->Write(PopEndTag()); } }
[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button
in the upper-left corner of the page.
Requirements
Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family
See Also
HtmlTextWriter Class | HtmlTextWriter Members | System.Web.UI Namespace | PushEndTag
Show: