HtmlTextWriter.GetTagKey(String) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Obtains the HtmlTextWriterTag enumeration value associated with the specified markup element.
protected:
virtual System::Web::UI::HtmlTextWriterTag GetTagKey(System::String ^ tagName);
protected virtual System.Web.UI.HtmlTextWriterTag GetTagKey (string tagName);
abstract member GetTagKey : string -> System.Web.UI.HtmlTextWriterTag
override this.GetTagKey : string -> System.Web.UI.HtmlTextWriterTag
Protected Overridable Function GetTagKey (tagName As String) As HtmlTextWriterTag
Parameters
- tagName
- String
The markup element for which to obtain the HtmlTextWriterTag.
Returns
The HtmlTextWriterTag enumeration value; otherwise, if tagName
is not associated with a specific HtmlTextWriterTag value, Unknown.
Examples
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 override void RenderBeginTag(string tagName)
{
// Call the overloaded RenderBeginTag(HtmlTextWriterTag)
// method.
RenderBeginTag(GetTagKey(tagName));
}
Public Overloads Overrides Sub RenderBeginTag(ByVal tagName As String)
' Call the overloaded RenderBeginTag(HtmlTextWriterTag) method.
RenderBeginTag(GetTagKey(tagName))
End Sub
Remarks
If tagName
is null
, an empty string (""), or cannot be found in the table of markup tag names, the GetTagKey method returns the Unknown field.
Applies to
See also
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기