HtmlTextWriter.RenderBeforeContent Method ()

 

Writes any text or spacing before the content and after the opening tag of a markup element.

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

abstract RenderBeforeContent : unit -> string
override RenderBeforeContent : unit -> string

Return Value

Type: System.String

The text or spacing to write prior to the content of the element. If not overridden, RenderBeforeContent returns null.

The RenderBeforeContent method can be useful if you want to insert child elements into the current markup element before the inner markup.

Notes to Inheritors:

The HtmlTextWriter class implementation of the RenderBeforeContent method returns null. Override RenderBeforeContent if you want to write text or spacing after the opening tag but ahead of the element content.

The following code example shows how to override the RenderBeforeContent method to determine whether a class derived from the HtmlTextWriter class is about to render a <label> element. If so, the RenderBeforeContent override inserts the opening tag of a <font> element immediately after the opening tag of the <label> element. If it is not a <label> element, the RenderBeforeContent base method is used.

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

.NET Framework
Available since 1.1
Return to top
Show: