ArticleDirectory
In the past, when page data was bound, we often encountered the usage of <% # %>, which was not checked at the time. Today we encountered a problem in JS, how to get the ID of the server control, so I think of this, first talk about the meaning of this symbol, this is also the information I checked online:
1. The variable name in <% = %>, such:
<Div>
<H1> Hello World <P> welcome to beginning ASP. NET 3.5 on<% =
Datetime. Now. tostring () %></P>
</Div>
Output result:
Hello World
Welcome to beginning ASP. NET 3.5 on 15:53:08
2. <% # %> Data Binding
For example: <% # Databinder. (container. dataitem, "classname") %>
CompleteCode: <Asp: datalist id = "classlist" runat = "server">
<Itemtemplate> <% # databinder. (container. dataitem, "classname") %>
</Itemtemplate>
</ASP: datalist> </TD>
3. <% @ %> indicates reference.
For example, you can see the following code on many. aspx pages:
<% @ Page Language = "C #" codefile = "default. aspx. cs" inherits = "_ default" %>
4. <%> A typical ASPProgramStatement.
Example: <tr bgcolor = "# ffffff">
<TD Height = "20">
<Div align = "center"> category: </div>
</TD>
<TD Height = "9"> & nbsp;
<% St_getlist (); %>
</TD>
</Tr>
The above is a download from http://www.cnblogs.com/gnagwang/archive/2010/07/14/1777130.html.
Hope you can help new friends