XPathBinder.Select Method (Object, String, IXmlNamespaceResolver)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

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


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.

Type: System.String

The XPath query that retrieves a list of nodes.

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
Available since 2.0
Return to top