views:

3070

answers:

3

What is the difference between having <%# Eval("State") %> in your aspx page or <%# DataBinder.Eval(Container.DataItem,"state") %> in your aspx page?

Thanks, X

+6  A: 

There is no difference. The "Eval" method is just a shortcut for the DataBinder.Eval(Container.DataItem, "blah") method.

Timothy Khouri
+2  A: 

the Eval method is just a shortcut of the latter

jmein
+11  A: 

Eval("State") is a simplified form of the DataBinder.Eval(Container.DataItem, "State") syntax. It only works inside of data-bound template controls.

For more info, see the MSDN documentation.

Jeromy Irvine