HtmlTextWriter.RenderBeginTag Method (String)
Writes the opening tag of the specified markup element to the output stream.
Assembly: System.Web (in System.Web.dll)
To generate a markup element by using the RenderBeginTag method, first call the AddAttribute and the AddStyleAttribute methods, as necessary, to specify any element attributes or style attributes that are to appear in the opening tag of the element. After generating the inner markup, call the RenderEndTag method to generate the closing tag.
The following code example shows how to call the RenderBeginTag method in a custom control to render the opening tag of a non-standard MyTag element. The code example then calls the method to render inner markup, and then calls the RenderEndTag method to close the element.
This code example generates the following markup:
Contents of MyTag
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.