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
Параметры
Возвращаемое значение
Значение указанного атрибута.
Примеры
В следующем примере кода демонстрируется реализация 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