IAttributeAccessor.GetAttribute(String) IAttributeAccessor.GetAttribute(String) IAttributeAccessor.GetAttribute(String) IAttributeAccessor.GetAttribute(String) Method

Definición

Cuando se implementa mediante una clase, recupera la propiedad de atributo especificada desde el control de servidor.When implemented by a class, retrieves the specified attribute property from the server control.

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

Parámetros

key
String String String String

String que representa el nombre del atributo del control de servidor.A String that represents the name of the server control attribute.

Devoluciones

Valor del atributo especificado.The value of the specified attribute.

Ejemplos

En el ejemplo de código siguiente se muestra una GetAttribute implementación del método.The following code example demonstrates an implementation of the GetAttribute method.

// 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

Se aplica a