Eval is common in ASP. net1.1
The binding syntax is used. It is "one-way", that is, when the data source is bound, the corresponding value is assigned to the control, and the eval task is completed.
The so-called "two-way" of BIND is: when binding
The corresponding values of the data source are assigned to the control. when the control is submitted, the user's input values are automatically extracted.
Document. getelementbyid ('Code _ closed_text_145659 '). style. Display = 'none ';
Document. getelementbyid ('Code _ open_image_145659 '). style. Display = 'inline ';
Document. getelementbyid ('Code _ open_text_145659 '). style. display = 'inline'; "src =" http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif "alt =" "width =" 11 "Height =" 16 "align =" TOP "> document. getelementbyid ('Code _ open_text_145659 '). style. display = 'none ';
Getelementbyid ('Code _ closed_image_145659 '). style. Display = 'inline ';
Getelementbyid ('Code _ closed_text_145659 '). style. display = 'inline'; "src =" http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif "alt =" "width =" 11 "Height =" 16 "align =" TOP "> 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
>
Another example:
Eval: bound to the display of read-only data
BIND: You can bind read-only data or update data. The bind method also associates fields with the property bound to the control to enable
Update, insert, delete, and other methods can be used for corresponding processing.
The data bound to eval and bind is in the <% #
%> Display. If you want to 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
)
%>
Display
10-digit address.
2. Determine the displayed information:
<%
#(
Eval
(
"
If_delete
"
). Tostring
=
"
Yes
"
?
"
Deleted
Division
"
:
"
Not deleted
"
%> Embedded-<%> an embedded code block is server code that executes
The page's render phase. The code in the block can execute Programming
Statements and call functions in the current page class.
Http://msdn2.microsoft.com/en-gb/library/ms178135 (vs.80). aspx
<% =
%> Most useful for displaying single pieces of information.
Http://msdn2.microsoft.com/en-us/library/6dwsdcf5 (vs.71). aspx
<% #
%> Data binding expression syntax.
Http://msdn2.microsoft.com/en-us/library/bda9bbfx.aspx
<% $
%> ASP. NET expression.
Http://msdn2.microsoft.com/en-us/library/d5bd1tad.aspx
<% @
%> Directive syntax.
Http://msdn2.microsoft.com/en-us/library/xz702w3e (vs.80). aspx
<% --
-- %> Server-side comments.
Http://msdn2.microsoft.com/en-US/library/4acf8afk.aspx