ConfigurationElement.GetAttributeValue Method (String)

 

Returns the value of the specified attribute.

Namespace:   Microsoft.Web.Administration
Assembly:  Microsoft.Web.Administration (in Microsoft.Web.Administration.dll)

public object GetAttributeValue(
	string attributeName
)

Parameters

attributeName
Type: System.String

The name of the requested attribute.

Return Value

Type: System.Object

An object that represents the requested attribute, if it exists; otherwise, null.

Exception Condition
ArgumentNullException

The attributeName parameter is null or empty.

If the name of the requested attribute is not in the value of the RawAttributes property, this method returns null.

You can also get the attribute value by using the Item property or the ConfigurationAttribute.Value property. GetAttributeValue is the preferred method.

The following example gets the attribute value.

Return to top
Show: