AttributeCollection.Add Method

Adds an attribute to a server control's AttributeCollection object.

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

public:
void Add (
	String^ key, 
	String^ value
)
public void Add (
	String key, 
	String value
)
public function Add (
	key : String, 
	value : String
)
Not applicable.

Parameters

key

The attribute name.

value

The attribute value.

If the string in the value parameter contains an ampersand (&), the character is automatically encoded. The resulting HTML representation is "&".

The following example shows how to use the Add method to programmatically add an attribute to an ASP.NET server control AttributeCollection object.

No code example is currently available or this language may not be supported.

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: