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

Xaisoft picture Xaisoft · Nov 6, 2008 · Viewed 29.9k times · Source

What is the difference between having

<%# Eval("State") %>

in your aspx page, versus having

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

in your aspx page?

Answer

Jeromy Irvine picture Jeromy Irvine · Nov 6, 2008

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.