HtmlTextWriter::RenderBeginTag Method (String)
Writes the opening tag of the specified markup element to the output stream.
Assembly: System.Web (in System.Web.dll)
Parameters
- tagName
- Type: System::String
A string containing the name of the markup element for which to render the opening tag.
Use the RenderBeginTag override of the RenderBeginTag(String) method, if the markup element is not one of the HtmlTextWriterTag enumeration values.
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 Write(String) method to render inner markup, and then calls the RenderEndTag method to close the element.
This code example generates the following markup:
<MyTag>
Contents of MyTag
</MyTag>
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.