System.Web.UI.AttributeCollection Class

Provides object-model access to all attributes declared in the opening tag of an ASP.NET server control element. This class cannot be inherited.

See Also: AttributeCollection Members

Syntax

public sealed class AttributeCollection

Remarks

Individual items in the collection return a string object as their value. If there are no attribute items in the collection, the collection returns null.

Attributes on an HTML server control are programmatically available through the System.Web.UI.HtmlControls.HtmlControl.Attributes property, which is inherited by all HTML server controls. ASP.NET exposes attributes of HTML server controls as properties of those controls.

You can add attributes to a Web server control through the System.Web.UI.WebControls.WebControl.Attributes property, which is inherited by all Web server controls. The attributes in the attributes collection for a Web server control do not necessarily correspond to the control's strongly typed properties for that control.

Requirements

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