IAttributeAccessor.GetAttribute(String) Method

Definition

When implemented by a class, retrieves the specified attribute property from the server control.

C#
public string GetAttribute (string key);

Parameters

key
String

A String that represents the name of the server control attribute.

Returns

The value of the specified attribute.

Examples

The following code example demonstrates an implementation of the GetAttribute method.

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];
}

Applies to

Produto Versões
.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, 4.8.1