IAttributeAccessor.GetAttribute(String) Metoda

Definicja

Po zaimplementowaniu przez klasę pobiera określoną właściwość atrybutu z kontrolki serwera.

C#
public string GetAttribute (string key);

Parametry

key
String

Element String reprezentujący nazwę atrybutu kontroli serwera.

Zwraca

String

Wartość określonego atrybutu.

Przykłady

Poniższy przykład kodu przedstawia implementację GetAttribute metody .

C#
// 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];
}

Dotyczy

Produkt Wersje
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8