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.
- 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.
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.