When binding in ASP.NET within FormView, GridView or DetailsView, one could use data-binding expressions with this tag <%# %>. There are two functions, which are Eval and Bind, used frequently. For instance, suppose you a data source has the field named "ProductName", you could bind it as follows:
<%# Eval('ProductName')%> OR <%# Bind('ProductName')%>
So what is the difference between the two functions?
The difference is, according to MSDN, the Eval function is used to define one-way (read-only) binding. The Bind function is used for two-way (updatable) binding.
Sharing the joy of coding in C#, Asp.Net MVC, JavaScript, HTML5, TDD/BDD, DDD and anything code related.
About Cullen
- Software Engineer/Architect
- Christian, Father, Software Developer/Architect who enjoys technology and using it to make people's lives easier!