HtmlTextWriter.GetTagKey Method
.NET Framework 3.0
Obtains the HtmlTextWriterTag enumeration value associated with the specified markup element.
Namespace: System.Web.UI
Assembly: System.Web (in system.web.dll)
Assembly: System.Web (in system.web.dll)
protected HtmlTextWriterTag GetTagKey ( String tagName )
protected function GetTagKey ( tagName : String ) : HtmlTextWriterTag
Not applicable.
Parameters
- tagName
The markup element for which to obtain the HtmlTextWriterTag.
Return Value
The HtmlTextWriterTag enumeration value; otherwise, if tagName is not associated with a specific HtmlTextWriterTag value, Unknown.The following code example shows how to override the overload of the RenderBeginTag method that takes a string as its parameter. The string is passed to the GetTagKey method, which converts it to the corresponding HtmlTextWriterTag enumeration member, and then passes that to the RenderBeginTag overload that takes a HtmlTextWriterTag enumeration value as a parameter.
virtual void RenderBeginTag( String^ tagName ) override { // Call the overloaded RenderBeginTag(HtmlTextWriterTag) method. RenderBeginTag( GetTagKey( tagName ) ); }
public void RenderBeginTag(String tagName)
{
// Call the overloaded RenderBeginTag(HtmlTextWriterTag)
// method.
RenderBeginTag(GetTagKey(tagName));
} //RenderBeginTag
Community Additions
ADD
Show: