System.Web.UI.HtmlTextWriter.AddAttribute Method

Adds the specified markup attribute and value, along with an System.Web.UI.HtmlTextWriterAttribute enumeration value, to the opening tag of the element that the System.Web.UI.HtmlTextWriter object creates with a subsequent call to the erload:System.Web.UI.HtmlTextWriter.RenderBeginTag method.

Syntax

protected virtual void AddAttribute (string name, string value, HtmlTextWriterAttribute key)

Parameters

name
A string containing the name of the attribute to add.
value
A string containing the value to assign to the attribute.
key
An System.Web.UI.HtmlTextWriterAttribute that represents the attribute.

Remarks

Use the HtmlTextWriter.AddAttribute(string, string, HtmlTextWriterAttribute) overload of the HtmlTextWriter.AddAttribute(string, string, HtmlTextWriterAttribute) method only when inheriting from the System.Web.UI.HtmlTextWriter class. It enables you to create new name and key pairs for attributes.

Requirements

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