1. <% # Eval ("this is the database Field") %>
2. <% = Object layer field attribute %>
3. <% is equivalent to background %>, for example:
<% If (! String. IsNullOrEmpty (base. StrCompanyName ))
{%>
<Span style = "font-size: 10pt; font-weight: bold;">
<Br/>
<% = Base. StrCompanyName %>
</Span>
<% }%>
Asp.net Eval () Four binding methods
1. Data Binding syntax in 1.x
<Asp: Literal id = "liteval" runat = "server" Text = '<% # DataBinder. Eval (Container. DataItem, "userName") %>'/>
2. 2.x simplified Eval Data Binding syntax
<Asp: Literal id = "litEval1" runat = "server" Text = '<% Eval ("userName") %>'/>
3. Method overload of method 2
<A href = '<% # Eval ("userId", "Default. aspx? Id = {0} ") %> '> <% # Eval (" userName ") %> </a>
4. Bind two eval values at the same time.
<A href = '<% # string. Format ("Default. aspx? Id = {0} & role = {1} ", Eval (" userId "), Eval (" userRole ") %> '> <% # Eval (" userName ") %> </a>
This article is from the Don't Know blog, please be sure to keep this source http://3941954.blog.51cto.com/3931954/1217083