In the asp.net application, common <% @ %>, <% # %>, and <% = %> On the asp.net page. Use <% $ %> to bind a resource project to a global project, and use <%: %> to bind ViewData to asp.net mvc.
<% @ %> It is mainly used to define pages, introduce controls, components, and set Cache on web pages:
1: <%@ Page %>
2: <%@ Assembly %>
3: <%@ Import %>
4: <%@ MasterType %>
5: <%@ OutputCache %>
6: <%@ PreviousPageType %>
7: <%@ Reference %>
8: <%@ Register %>
<% # %> It is mainly used to bind background data to the foreground. Generally, a corresponding DataBind () is required in the background for binding.
1: <asp:GridView ID="gvProducts" runat="server">
2: <Columns>
3: <asp:TemplateField>
4: <ItemTemplate>
5: <%# Eval("ProductName") %>
6: </ItemTemplate>
7: </asp:TemplateField>
8: </Columns>
9: </asp:GridView>
<% = %> It is mainly used to input background variables in the foreground.
1: <%= Page.IsPostBack %>
<% $ %> Used to specify the resource item corresponding to the foreground page in the globalization solution.
1: <asp:Label ID="lblAmount" runat="server" Text="<%$ Resources:TestSiteResources, TotalAmount %>"></asp:Label>
<%: %> Bind ViewData to the asp.net mvc project.
1: <%: ViewData["Message"] %>