HtmlTextWriter.GetTagKey(String) HtmlTextWriter.GetTagKey(String) HtmlTextWriter.GetTagKey(String) HtmlTextWriter.GetTagKey(String) Method

定義

指定したマークアップ要素に関連付けられた HtmlTextWriterTag 列挙値を取得します。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

パラメーター

tagName
String String String String

HtmlTextWriterTag の取得対象のマークアップ要素。The markup element for which to obtain the HtmlTextWriterTag.

戻り値

HtmlTextWriterTag 列挙値。tagName が特定の HtmlTextWriterTag 値に関連付けられていない場合は UnknownThe HtmlTextWriterTag enumeration value; otherwise, if tagName is not associated with a specific HtmlTextWriterTag value, Unknown.

次のコード例は、のオーバー ロードをオーバーライドする方法を示します、RenderBeginTagをパラメーターとして文字列を受け取るメソッド。The following code example shows how to override the overload of the RenderBeginTag method that takes a string as its parameter. 文字列が渡される、GetTagKeyメソッドで、対応に変換しますHtmlTextWriterTag列挙型メンバー、しに渡す、RenderBeginTagを受け取るオーバー ロード、HtmlTextWriterTag列挙値をパラメーターとして。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

注釈

場合tagNamenull、空の文字列 ("")、またはマークアップ タグの名前のテーブルに見つかりません、GetTagKeyメソッドが返す、Unknownフィールド。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.

適用対象

こちらもご覧ください