Click or drag to resize
XElementExtensionsGetAttributeStringValue Method
Gets the attribute value as string type from element source data given by attributeName. If no attribute is found or source data are not provided returns defaultValue default value. Ignores case in attribute name and defined namespace.

Namespace: CMS.Helpers
Assembly: CMS.Helpers (in CMS.Helpers.dll) Version: 12.0.0
Syntax
C#
public static string GetAttributeStringValue(
	this XElement element,
	string attributeName,
	string defaultValue = null
)

Parameters

element
Type: System.Xml.LinqXElement
Source XML element
attributeName
Type: SystemString
Attribute name
defaultValue (Optional)
Type: SystemString
Default value

Return Value

Type: String

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type XElement. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also