IAttributeAccessor.GetAttribute(String) メソッド

定義

クラスによって実装された場合は、サーバー コントロールから指定した属性プロパティを取得します。

public:
 System::String ^ GetAttribute(System::String ^ key);
public string GetAttribute(string key);
abstract member GetAttribute : string -> string
Public Function GetAttribute (key As String) As String

パラメーター

key
String

サーバー コントロール属性の名前を表す String

返品

指定した属性の値。

次のコード例は、 GetAttribute メソッドの実装を示しています。

// Implement the GetAttribute method for the control. When
// this method is called from a page, the values for the control's
// properties can be displayed in the page.
public String GetAttribute(String name)
{
   return (String)ViewState[name];
}
' Implement the GetAttribute method for the control. When
' this method is called from a page, the values for the control's
' properties can be displayed in the page.
Public Function GetAttribute(name As String) As String Implements IAttributeAccessor.GetAttribute
   Return CType(ViewState(name), String)
End Function 'GetAttribute

適用対象