开发者

Difference between usage of eval expressions in asp.net

开发者 https://www.devze.com 2023-02-27 08:24 出处:网络
I have been just trying to understand what does eval do. Suppose, I have a gridview - what is the difference if I use

I have been just trying to understand what does eval do. Suppose, I have a gridview - what is the difference if I use

Text='<%# Eval("FieldName开发者_如何学C") %>' in .aspx

and

DataBinder.Eval(e.Row.DataItem, "FieldName") in aspx.cs

Can anyone explain in simple terms what does each one of these do and in what case should we use them? Or can they be used interchangeably?


Generally, there is no difference between these two methods as the Eval actually calls the DataBinder.Eval method. For more details, please refer to

DataBinder.Eval vs Eval

0

精彩评论

暂无评论...
验证码 换一张
取 消