IAttributeAccessor.GetAttribute(String) Metode
Definisi
Penting
Beberapa informasi terkait produk prarilis yang dapat diubah secara signifikan sebelum dirilis. Microsoft tidak memberikan jaminan, tersirat maupun tersurat, sehubungan dengan informasi yang diberikan di sini.
Saat diimplementasikan oleh kelas, mengambil properti atribut yang ditentukan dari kontrol server.
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
Parameter
Mengembalikan
Nilai atribut yang ditentukan.
Contoh
Contoh kode berikut menunjukkan implementasi GetAttribute metode .
// 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