Example of applying Eval and Bind to Data Binding in Asp.net

Source: Internet
Author: User

Keywords:

Eval (single-item binding) data binding is generally used for data display. The reflection principle of the Eval data binding application to return data.
Bind (bidirectional binding) bidirectional data binding not only displays data, but also automatically writes interface data changes back to the bound data source.

Eval

One-way data binding: displays data in the data source on the interface. When we mention data presentation, we must consider the data format, such as the date format. Of course, this is what Eval cares about.

General Data Binding

<% # Eval ("attribute name") %>

Data Binding with Data Format

<% # Eval ("attribute name", "{0: Format String}") %>

Data Binding with formatted strings

<% # Eval ("attribute name", "Home. aspx? Id = {0} ") %>

Bind

General Data Binding

<% # Bind ("property name") %>

Format-based Data Binding

<% # Bind ("property name", "{0: Data Format}") %>

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.