My Photo
Name:
Location: United States

Wednesday, April 18, 2007

Eval Vs Bind

use of two distinct operators for binding: Eval and Bind. Eval is an operator you use in data-binding expressions to access a public property on the bound data item. Functionally speaking, it is nearly equivalent to the DataBinder.Eval method you would have used in ASP.NET 1.x in the same situation. As used in the preceding code, Eval is an ASP.NET 2.0-only feature and will generate a compile error if used in an ASP.NET 1.x application. Furthermore, it will throw an exception if used in an ASP.NET 2.0 page outside of a template. The Bind operator is like Eval, except that it adds the ability to write data back to the original data source field. In the previous code snippet, notice that at display time the Bind operator sets the SelectedValue property of the DropDownList control with the value of the country field from the data source. So, how are values passed back to the control for updating the data source?

Powered by Bleezer

0 Comments:

Post a Comment

<< Home