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

后端 未结 2 1339
刺人心
刺人心 2020-12-14 15:15

I have seen bind and eval used interchangeably especially in ASP.NET GridViews. What is the difference?

相关标签:
2条回答
  • 2020-12-14 15:25

    Eval is one-way, read only databinding.

    Bind is two-way, read/write databinding.

    See here and here.

    0 讨论(0)
  • 2020-12-14 15:43

    Bind() is used for two-way databinding. So when used with the proper type of datasource, it will pull the altered values out of the GridView or other control, and save them back to the database.

    Eval() is a one-way, "read only" way to bind the values.

    0 讨论(0)
提交回复
热议问题