SecurityElement.IsValidAttributeValue(String) Method

Definition

Determines whether a string is a valid attribute value.

public:
 static bool IsValidAttributeValue(System::String ^ value);
public static bool IsValidAttributeValue (string value);
public static bool IsValidAttributeValue (string? value);
static member IsValidAttributeValue : string -> bool
Public Shared Function IsValidAttributeValue (value As String) As Boolean

Parameters

value
String

The attribute value to test for validity.

Returns

true if the value parameter is a valid XML attribute value; otherwise, false.

Examples

The following code shows the use of the IsValidAttributeValue method to determine whether a string is a valid attribute value. This code example is part of a larger example provided for the SecurityElement class.

if ( SecurityElement::IsValidAttributeName( attributeName ) &&
       SecurityElement::IsValidAttributeValue( attributeValue ) )
if (SecurityElement.IsValidAttributeName(attributeName) &&
    SecurityElement.IsValidAttributeValue(attributeValue))
If SecurityElement.IsValidAttributeName(attributeName) AndAlso SecurityElement.IsValidAttributeValue(attributeValue) Then

Remarks

This method can be used to test an attribute before adding it to a security element.

Applies to