Export (0) Print
Expand All

XPathBinder.Select Method (Object, String, IXmlNamespaceResolver)

Uses an XPath data-binding expression at run time to return a list of nodes, using the IXmlNamespaceResolver object specified to resolve namespace prefixes in the XPath expression.

Namespace:  System.Web.UI
Assembly:  System.Web (in System.Web.dll)

public static IEnumerable Select(
	Object container,
	string xPath,
	IXmlNamespaceResolver resolver
)

Parameters

container
Type: System.Object

The IXPathNavigable object reference that the expression is evaluated against. This must be a valid object identifier in the page's specified language.

xPath
Type: System.String

The XPath query that retrieves a list of nodes.

resolver
Type: System.Xml.IXmlNamespaceResolver

The IXmlNamespaceResolver object used to resolve namespace prefixes in the XPath expression.

Return Value

Type: System.Collections.IEnumerable
An IEnumerable list of nodes.

You can use the Select method declaratively if you want to simplify the retrieval of a set of nodes using an XPath query. To do so, you must place the <%# and %> tags, which are also used in standard ASP.NET data binding, around the XPath query and an IXmlNamespaceResolver object to resolve the namespace reference.

For any of the list ASP.NET server controls, such as DataList, DataGrid, or Repeater, the container parameter should be Container.DataItem.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft