System.Web.UI.HtmlControls.HtmlControl.GetAttribute Method

Gets the value of the named attribute on the System.Web.UI.HtmlControls.HtmlControl control.

Syntax

protected virtual string GetAttribute (string name)

Parameters

name
The name of the attribute. This argument is case-insensitive.

Returns

The value of this attribute on the element, as a string value. If the specified attribute does not exist on this element, returns an empty string ("").

Remarks

Use the HtmlControl.GetAttribute(string) method to access an attribute on the System.Web.UI.HtmlControls.HtmlControl server control. All HTML server controls store their attributes in the System.Web.UI.Control.ViewState property. HTML attributes are treated by the ASP.NET page framework as properties on the HTML server control to which they belong. The HtmlControl.GetAttribute(string) method's name parameter is case-insensitive.

Requirements

Namespace: System.Web.UI.HtmlControls
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0