Html32TextWriter::RenderBeforeContent Method
Writes any tab spacing or font information that appears before the content that is contained in an HTML element.
Assembly: System.Web (in System.Web.dll)
Return Value
Type: System::StringThe font information or spacing to write before rendering the content of the HTML element; otherwise, if there is no such information to render, nullptr.
The following code example demonstrates how to override the RenderBeforeContent method. The code checks whether a th element is being rendered, and then uses the SupportsBold method to check whether the requesting device can display bold formatting. If the device supports bold formatting, the RenderBeforeContent method writes the opening tag of a b element. If the device does not support bold formatting, the RenderBeforeContent method writes the opening tag of a font element with a color attribute set to the hexadecimal value for red.
Next, each method checks whether an h4 element is being rendered, and then uses the SupportsItalic property to check whether the requesting device can display italic formatting. If the device supports italic formatting, the RenderBeforeContent method writes the opening tag of an i element. If the device does not support italic formatting, the RenderBeforeContent method writes the opening tag of a font element with a color attribute set to the hexadecimal value for navy blue.
This code example is part of a larger example provided for the Html32TextWriter class.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.