HtmlControl.GetAttribute(String) 方法

定義

取得 HtmlControl 控制項上已命名屬性的值。

protected:
 virtual System::String ^ GetAttribute(System::String ^ name);
protected virtual string GetAttribute (string name);
abstract member GetAttribute : string -> string
override this.GetAttribute : string -> string
Protected Overridable Function GetAttribute (name As String) As String

參數

name
String

屬性的名稱。 這個引數不區分大小寫。

傳回

String

項目上這個屬性的值,為 String 值。 如果指定的屬性不存在這個項目上,則會傳回空字串 ("")。

備註

GetAttribute使用 方法來存取伺服器控制項上的 HtmlControl 屬性。 所有 HTML 伺服器控制項都會將其屬性儲存在 屬性中 Control.ViewState 。 HTML 屬性會由 ASP.NET 網頁架構視為其所屬 HTML 伺服器控制項上的屬性。 方法 GetAttribute 的參數 name 不區分大小寫。

適用於

另請參閱