Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the difference between <#eval and <#bind in asp.net

Tags:

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

like image 258
Dr. Rajesh Rolen Avatar asked Nov 25 '09 12:11

Dr. Rajesh Rolen


1 Answers

Eval does one-way binding; Bind is two-way.

If you bind a value using Eval, it is read-only. You can only view the data.

If you bind a value using Bind, changes to values will be reflected in the database as well.

You can refer to this similar post here on stack overflow: What is the difference between <%# Bind("") %> and <%# Eval("") %> in ASP.NET?

like image 137
Harryboy Avatar answered Oct 02 '22 20:10

Harryboy