aspxtreme

DataBinder.Eval Method

System.Web.UI Namespace   DataBinder Class


Uses reflection to parse and evaluate a data binding expression against an object at runtime. This method allows RAD designers, such as Visual Studio .NET, to easily generate and parse data binding syntax. This method can also be used declaratively on a Web Forms page to simplify casting from one type to another.

Overload List

1. Evaluates data binding expressions at runtime.

2. Evaluates data binding expressions at runtime and formats the output as text to be displayed in the requesting browser.


Example

The following example demonstrates how you can use the Eval method to declaratively bind to a Price field. This example uses container syntax that assumes you are using one of the list Web server controls. The format parameter formats the number as a locale-specific currency string that will be displayed by the requesting browser.

NOTE: This example shows how to use one of the overloaded versions of Eval. For other examples that may be available, see the individual overload topics.

<%# DataBinder.Eval ( Container.DataItem, "Price", "{0:c}" %>
See Also

DataBinder Members



Books and more ...


Suggested Reading

Need a break ?



Previous page Back to top Next page

Check out related books at Amazon

© 2000-2008 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support aspxtreme