Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

GetAttributeValue Method

IIS 7.0

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, nullNothingnullptrunita null reference (Nothing in Visual Basic).

ExceptionCondition
ArgumentNullException

The attributeName parameter is nullNothingnullptrunita null reference (Nothing in Visual Basic) or empty.

If the name of the requested attribute is not in the value of the RawAttributes property, this method returns nullNothingnullptrunita null reference (Nothing in Visual Basic).

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.

// Use any of the following lines to retrieve the attribute value.
// attributeBag[ConfigurationDemoGlobals.AttributeName] = "name";
attributeBag[ConfigurationDemoGlobals.AttributeName] =
    moduleproviderelement.GetAttributeValue("name");
// attributeBag[ConfigurationDemoGlobals.AttributeName] =
//    moduleproviderelement["name"];


Community Additions

ADD
Show:
© 2015 Microsoft