指定した HtmlTextWriterTag 列挙値に関連付けられたマークアップ要素を取得します。
名前空間: System.Web.UI
アセンブリ: System.Web (system.web.dll 内)
構文
'宣言
Protected Overridable Function GetTagName ( _
tagKey As HtmlTextWriterTag _
) As String
'使用
Dim tagKey As HtmlTextWriterTag
Dim returnValue As String
returnValue = Me.GetTagName(tagKey)
protected virtual string GetTagName (
HtmlTextWriterTag tagKey
)
protected:
virtual String^ GetTagName (
HtmlTextWriterTag tagKey
)
protected String GetTagName (
HtmlTextWriterTag tagKey
)
protected function GetTagName (
tagKey : HtmlTextWriterTag
) : String
適用できません。
パラメータ
- tagKey
マークアップ要素の取得対象の HtmlTextWriterTag。
戻り値
マークアップ要素を表す文字列。
解説
tagKey が有効な HtmlTextWriterTag 値ではない場合、GetTagName メソッドは空の文字列 ("") を返します。
使用例
WriteEndTag メソッドを使用して、<font> 要素を閉じる方法を次のコード例に示します。WriteEndTag メソッドは、GetTagName メソッドを呼び出し、Font 値を文字列に変換します。
' Close the Font element.
Me.WriteEndTag(GetTagName(HtmlTextWriterTag.Font))
End If
// Close the Font element.
Write(GetTagName(HtmlTextWriterTag.Font));
// Close the Font element.
WriteEndTag( GetTagName( HtmlTextWriterTag::Font ) );
// Close the Font element.
Write(GetTagName(HtmlTextWriterTag.Font));
}
プラットフォーム
Windows 98,Windows Server 2000 SP4,Windows CE,Windows Millennium Edition,Windows Mobile for Pocket PC,Windows Mobile for Smartphone,Windows Server 2003,Windows XP Media Center Edition,Windows XP Professional x64 Edition,Windows XP SP2,Windows XP Starter Edition
Microsoft .NET Framework 3.0 は Windows Vista,Microsoft Windows XP SP2,および Windows Server 2003 SP1 でサポートされています。
バージョン情報
.NET Framework
サポート対象 : 3.0,2.0,1.1,1.0
参照
関連項目
HtmlTextWriter クラス
HtmlTextWriter メンバ
System.Web.UI 名前空間
TextWriter
HtmlTextWriterTag