System.Web.UI.XPathBinder Class

Provides support for rapid application development (RAD) designers to parse data-binding expressions that use XPath expressions. This class cannot be inherited.

See Also: XPathBinder Members


public sealed class XPathBinder


You can use the overloaded XPathBinder.Eval(object, string) method of this class to bind to the result of an XPath expression executed against an object that implements the System.Xml.XPath.IXPathNavigable interface, such as an System.Xml.XmlNode. You can use the XPathBinder.Select(object, string) method to retrieve the results of an XPath expression executed against an System.Xml.XPath.IXPathNavigable object as an IEnumerable list of nodes. This list of nodes can be enumerated directly or assigned to the DataSource property of a list control, such as a System.Web.UI.WebControls.Repeater or System.Web.UI.WebControls.DataList.

You can use a simplified version of data-binding syntax when using the System.Web.UI.XPathBinder methods declaratively. Instead of calling XPathBinder.Eval(Container.DataItem, xpath) you can use XPath(xpath). Similarly, instead of calling XPathBinder.Select(Container.DataItem, xpath), you can use XPathSelect(xpath) to retrieve an IEnumerable set of nodes. When using this simplified syntax, the XPathBinder.Eval(object, string) and XPathBinder.Select(object, string) methods assume a default Container.DataItem context object.

For more information about data binding to ASP.NET server controls, see Data-Binding Expression Syntax.


Namespace: System.Web.UI
Assembly: System.Web (in System.Web.dll)
Assembly Versions:
Since: .NET 2.0