GetAttributeValue Method (String, String)

Html Agility Pack

Collapse imageExpand ImageCopy imageCopyHover image
Helper method to get the value of an attribute of this node. If the attribute is not found, the default value will be returned.

Namespace: HtmlAgilityPack
Assembly: HtmlAgilityPack (in HtmlAgilityPack.dll) Version: 1.4.0.0 (1.4.0.0)

Syntax

C#
public string GetAttributeValue(
	string name,
	string def
)
Visual Basic
Public Function GetAttributeValue ( _
	name As String, _
	def As String _
) As String
Visual C++
public:
String^ GetAttributeValue(
	String^ name, 
	String^ def
)

Parameters

name
Type: System..::..String
The name of the attribute to get. May not be null.
def
Type: System..::..String
The default value to return if not found.

Return Value

The value of the attribute if found, the default value if not found.

See Also