评估与绑定之间的区别 [英] Difference between Eval and Bind
本文介绍了评估与绑定之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在ASP.Net中应该在哪里使用Eval,在哪里使用Bind Expression?谁能向我详细解释一下?我在网格中使用了Eval进行更新,但是当我按Edit时,整行都消失了.
Where should I use the Eval and and where should I use the Bind Expression in ASP.Net? Can anyone explain that to me in detail? I used the Eval in my grid to update, but when I press edit, the whole line is disappearing.
推荐答案
用于只读(单向数据绑定)数据绑定控制,它们是相同的(我猜Bind具有更多功能,因为它具有更多功能,但我无法确认).
对于2种方式的数据绑定(使用要在其中使用声明性数据绑定进行更新,插入等的数据源),您将需要使用#Bind.
就那么简单. Eval是只读的,Bind允许数据进行两种方式.
为什么不进行简单的Google搜索?
评估绑定差异:
^ ]
For a read-only (one way databinding) databound control, they are the same (I''m guessing Bind has slightly more overhead since it has more functionality, but I can''t confirm that).
For 2 way databinding (using a datasource in which you want to update, insert, etc with declarative databinding), you''ll need to use #Bind.
Simple as that. Eval is read only, Bind allows for data to go two ways.
Why dont do a simple google search?
eval bind difference:
http://www.google.co.in/search?q=eval+bind+difference&rls=com.microsoft:en-us&ie=UTF-8&oe=UTF-8&startIndex=&startPage=1&redir_esc=&ei=RKutTNzTK4yCvgOi-uT0Bg[^]
Eval()在只读数据时使用.如果可以更新数据,则使用Bind().
Eval() is used when data is read only. If data can be updated then Bind() is used.
这篇关于评估与绑定之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文