This documentation is archived and is not being maintained.

HtmlTextWriter.GetTagKey Method

Obtains the HtmlTextWriterTag enumeration value associated with the specified HTML element.

[Visual Basic]
Protected Overridable Function GetTagKey( _
   ByVal tagName As String _
) As HtmlTextWriterTag
[C#]
protected virtual HtmlTextWriterTag GetTagKey(
 string tagName
);
[C++]
protected: virtual HtmlTextWriterTag GetTagKey(
 String* tagName
);
[JScript]
protected function GetTagKey(
   tagName : String
) : HtmlTextWriterTag;

Parameters

tagName
The HTML element to obtain the HtmlTextWriterTag value for.

Return Value

The HtmlTextWriterTag value; if the tagName parameter is not associated with a specific HtmlTextWriterTag value, HtmlTextWriterTag.Unknown is returned.

Example

[Visual Basic] 
Overloads Public Overrides Sub RenderBeginTag(tagName As String)
   ' Call the overloaded RenderBeginTag(HtmlTextWriterTag) method.
   RenderBeginTag(GetTagKey(tagName))
End Sub 'RenderBeginTag


[C#] 
public override void RenderBeginTag(string tagName)
{
   // Call the overloaded RenderBeginTag(HtmlTextWriterTag)
   // method.
   RenderBeginTag(GetTagKey(tagName));
}

[C++] 
public:
   void RenderBeginTag(String* tagName) {
      // Call the overloaded RenderBeginTag(HtmlTextWriterTag) method.
      RenderBeginTag(GetTagKey(tagName));
   }

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family

See Also

HtmlTextWriter Class | HtmlTextWriter Members | System.Web.UI Namespace

Show: