Difference between usage of eval expressions in asp.net
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
精彩评论