Summary of output variables, eval data bindings, asp.net page

Source: Internet
Author: User
Keywords nbsp variable for backstage foreground
Tags .net applications asp asp.net bind data net project

In asp.net applications, the <%@%>, <%#%>, <%=%> that are commonly used on asp.net pages. Use the <%$%> binding resource project in a globalized project to use <%:%> bind viewdata in asp.net mvc.

<%@%> is primarily used to define page, introduce controls, components, set cache, and so on in a Web page:

<%@ Page%>
<%@ Assembly%>
<%@ Import%>
<%@ MasterType%>
<%@ OutputCache%>
<%@ PreviousPageType%>
<%@ Reference%>
<%@ Register%>
<%#%> is mainly used to bind background data to the foreground, generally in the background need to have a corresponding DataBind () in the execution binding. <asp:gridview id= "gvproducts" runat= "Server" >
<Columns>
<asp:TemplateField>
<ItemTemplate>
<%# Eval ("ProductName")%>
<ItemTemplate>
<asp:TemplateField>
<Columns>
<asp:GridView>

<%=%> is primarily used to enter background variables in the foreground.

<%= Page.IsPostBack%>

<%$%> is used to specify the resource items for the foreground page in the globalization solution.

<asp:label id= "Lblamount" runat= "Server" text= "<%$ resources:testresources, TotalAmount%>" >
<asp:Label>

<%:%> binds viewdata in the ASP.net MVC project.

<%: viewdata["message"]%> 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>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.