GetAttributeValue Method (String, Int32)

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 int GetAttributeValue(
	string name,
	int def
)
Visual Basic
Public Function GetAttributeValue ( _
	name As String, _
	def As Integer _
) As Integer
Visual C++
public:
int GetAttributeValue(
	String^ name, 
	int def
)

Parameters

name
Type: System..::..String
The name of the attribute to get. May not be null.
def
Type: System..::..Int32
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