For example:
Code
< Edititemtemplate >
< ASP: Label ID = "Cityidlabel1" Runat = "Server" Text = '<% # Eval ("cityid") % > '> </ ASP: Label >
< ASP: textbox ID = "Citytextbox" Runat = "Server" Text = '<% # BIND ("city") % > '> </ ASP: textbox >
</ Edititemtemplate >
Eval is a common binding syntax in ASP. net1.1. It is "one-way", that is, the corresponding value of the data source is assigned to the control during the binding, and the eval task is completed.
The so-called "two-way" of BIND is: when binding, assign the corresponding value on the data source to the control, and at the time of submission, automatically extract the value entered on the control.
Another example:
Eval: displays read-only data. BIND: You can bind read-only data or update data. The bind method also associates fields with the binding property of the control, this makes it possible to use the update, insert, and delete methods of data controls (such as the gridview) for corresponding processing.
The data bound to eval and bind is displayed in <% # %>. If you modify or operate the data to be displayed, it is also in <% # %>. For example:
1. Character Display of the displayed string:
<% #( Eval ( " Address " ). Tostring (). substring ( 0 , 10 ) %>
The 10-digit address is displayed.
2. Determine the displayed information:
<% #( Eval ( " If_delete " ). Tostring = " Yes " ? " Deleted " : " Not deleted " %>