<%# Eval("State") %> or <%# DataBinder.Eval(Container.DataItem, "state")%>

Viewed 30342

What is the difference between having

<%# Eval("State") %>

in your aspx page, versus having

<%# DataBinder.Eval(Container.DataItem, "State") %>

in your aspx page?

5 Answers

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.

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

the Eval method is just a shortcut of the latter

Related