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 learning on Asp.Net MVC, TDD/BDD, DDD and anything code related.
Wednesday, April 15, 2009
Subscribe to:
Post Comments (Atom)
About Cullen
- Sr. Software Engineer/Architect
- Cullen has been coding since 1991. He has been a Sr. Software Engineer/Architect for 11 years and counting. He enjoys coding for work as well as for fun. He loves learning from anyone and delights in sharing the little knowledge he possesses.
0 comments:
Post a Comment