System.Web.UI.AttributeCollection.AddAttributes Method

Adds attributes from the System.Web.UI.AttributeCollection class to the System.Web.UI.HtmlTextWriter object that is responsible for rendering the attributes as markup.

Syntax

public void AddAttributes (HtmlTextWriter writer)

Parameters

writer
An System.Web.UI.HtmlTextWriter instance that writes the attribute to the opening tag of an ASP.NET server control.

Remarks

This method copies all the server control's attributes to an System.Web.UI.HtmlTextWriter object so that they can be rendered by the next call to the HtmlTextWriter.RenderBeginTag(string) method.

For controls that are contained in other controls such as System.Web.UI.WebControls.Calendar and System.Web.UI.WebControls.CheckBoxList, you can potentially improve performance by rendering the contained controls directly. Rendering directly can be faster than rendering through the container control because container controls require that you copy all the child control attributes to the container control and render them after they are copied.

Requirements

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