IAttributeAccessor.GetAttribute(String) Metod
Definition
Viktigt
En del information gäller för förhandsversionen av en produkt och kan komma att ändras avsevärt innan produkten blir allmänt tillgänglig. Microsoft lämnar inga garantier, uttryckliga eller underförstådda, avseende informationen som visas här.
När den implementeras av en klass hämtar den angivna attributegenskapen från serverkontrollen.
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
Parametrar
Returer
Värdet för det angivna attributet.
Exempel
I följande kodexempel visas en implementering av GetAttribute metoden.
// 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