SecurityElement.Tag Property


Gets or sets the tag name of an XML element.

Namespace:   System.Security
Assembly:  mscorlib (in mscorlib.dll)

public string Tag { get; set; }

Property Value

Type: System.String

The tag name of an XML element.

Exception Condition

The tag is null.


The tag is not valid in XML.

In XML, the tag appears in the script as appears below:

<tag attributes>text</tag>

If this element has child elements, the children will replace text.

Assign only valid XML tag strings to this property. Use Escape to remove invalid characters from the string.

The following code shows the use of the Tag property to get the tag name of an XML element. This code example is part of a larger example provided for the SecurityElement class.

string xmlTreeName = xmlElement.Tag.ToString();

.NET Framework
Available since 1.1
Return to top