Thursday, August 30, 2012

What is the difference between <%# Bind(“”) %> and <%# Eval(“”) %> in ASP.NET?

Question : - 

In a gridview, we can use <%#Eval%> or <%#Bind%> to output values from a database. What is the difference between them?

Answer :-

  • Eval is one way binding, Bind is two way
  • If you bind a value using Eval, it is like a read only. You can only view the data.
  • If you bind a value using Bind, and if you do some change on the value it will reflect on the database also

No comments:

Post a Comment