System.Web.UI.XPathBinder.Eval Method

Evaluates XPath data-binding expressions at run time.

Syntax

public static object Eval (object container, string xpath)

Parameters

xpath
Documentation for this section has not yet been entered.
container
The System.Xml.XPath.IXPathNavigable object reference that the expression is evaluated against. This must be a valid object identifier in the page's specified language.

Returns

An object that results from the evaluation of the data-binding expression.

Remarks

You can use the XPathBinder.Eval(object, string) method declaratively if you want to simplify the casting of an XML node to a text string to be displayed on a browser. To do so, you must place the <%# and %> tags, which are also used in standard ASP.NET data binding, around the data-binding expression.

For any of the list ASP.NET server controls, such as System.Web.UI.WebControls.DataList, System.Web.UI.WebControls.DataGrid, or System.Web.UI.WebControls.Repeater, the container parameter should be Container.DataItem. If you are binding against the page, the container parameter should be Page.

Requirements

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