System.Security.SecurityElement.AddAttribute Method

Adds a name/value attribute to an XML element.

Syntax

public void AddAttribute (string name, string value)

Parameters

name
The name of the attribute.
value
The value of the attribute.

Remarks

Names and values in attributes should only contain valid XML attribute characters. XML attribute names must be unique. Use SecurityElement.Escape(string) to remove invalid characters from the string.

There is no support for quoted strings, so strings for name/value pairs should not contain quotes or other characters requiring quoting.

Requirements

Namespace: System.Security
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0