Export (0) Print
Expand All

HtmlTextWriter.RenderBeforeTag Method

Writes any text or spacing that occurs before the opening tag of a markup element.

Namespace:  System.Web.UI
Assembly:  System.Web (in System.Web.dll)

abstract RenderBeforeTag : unit -> string  
override RenderBeforeTag : unit -> string

Return Value

Type: System.String
The text or spacing to write before the markup element opening tag. If not overridden, a null reference (Nothing in Visual Basic).

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 a null reference (Nothing in Visual Basic). 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.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft