HtmlTextWriter.AddAttribute Method (String, String, HtmlTextWriterAttribute)

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

Namespace: System.Web.UI
Assembly: System.Web (in system.web.dll)

protected:
virtual void AddAttribute (
	String^ name, 
	String^ value, 
	HtmlTextWriterAttribute key
)
protected void AddAttribute (
	String name, 
	String value, 
	HtmlTextWriterAttribute key
)
protected function AddAttribute (
	name : String, 
	value : String, 
	key : HtmlTextWriterAttribute
)
Not applicable.

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 HtmlTextWriterAttribute that represents the attribute.

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

Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

Community Additions

ADD
Show: