HtmlTextWriter.RenderBeforeTag Method ()
Writes any text or spacing that occurs before the opening tag of a markup element.
Assembly: System.Web (in System.Web.dll)
Return Value
Type: System.StringThe text or spacing to write before the markup element opening tag. If not overridden, null.
The RenderBeforeTag method can be useful if you want to render additional opening tags before the opening tag of the intended element.
Notes to Implementers:
The HtmlTextWriter class implementation of the RenderBeforeTag method returns null. Override RenderBeforeTag if you want to write text or spacing ahead of the element opening tag.
The following code example shows how to override the RenderBeforeTag method to determine whether a class that is derived from the HtmlTextWriter class is about to render a <label> element. If so, the RenderBeforeTag override inserts the opening tag of a <font> element immediately before the <label> element. If it is not rendering a <label> element, the RenderBeforeTag base method is used.
Available since 1.1