About databinder. Eval eval bind

Source: Internet
Author: User

Simply put

<% # BIND ("field name") %> two-way binding read/write

<% # Eval ("name") %> Read Only
<% # Databinder. eval (container. dataitem, "sex") %> same as above

 

 

<% # Indicates data binding,

Eval is a read-only binding of data. The parent control (such as the gridview) of the bound child control cannot be used to receive modifications made by users. BIND is a bidirectional binding. The so-called bidirectional binding is a data source-display interface bidirectional data

Data Flow, that is, read/write.
Eval can be replaced with bind, but it will reduce the performance. Otherwise, it cannot be replaced.
The container is a container and refers to the parent control. dataitem refers to the current row of the data source bound to the parent control, not a field.

If only the value <% # eval ("field name") %> is displayed, you can.
You can modify the value <% # BIND ("field name") %>.

The following two types of display are the same

<% # Eval ("name") %>
<% # Databinder. eval (container. dataitem, "sex") %>

<% = Indicates that the output variable is equivalent to response. Write (XX ).

 

 

 

Basic Format of databinder. Eval
Databinder. eval (container. dataitem, "XXX", "{0 }")
<% # Databinder. eval (container. dataitem, "XXXX") %>
<% # Databinder. eval (container, "dataitem. XXXX") %>

Question 1: What are their differences?
Question 2: Can they replace each other?
Question 3: What are the containers and dataitems of databinder. eval (container. dataitem?

Answer 1: Eval is a read-only binding to data. The parent control (such as the gridview) of the bound child control cannot be used to receive user input modifications. BIND is a bidirectional binding. The so-called bidirectional binding is a data source-display interface bidirectional data

Data Flow, that is, read/write.
Answer 2: eval can be replaced with bind, but it will reduce the performance. Otherwise, it cannot be replaced.
Answer 3: container refers to the container and the parent control. dataitem refers to the current row of the data source bound to the parent control, not a field.

If only the value <% # eval ("field name") %> is displayed, you can.
You can modify the value <% # BIND ("field name") %>.

 

The following two types of display are the same

<% # Eval ("name") %>

<% # Databinder. eval (container. dataitem, "sex") %>

 

this article from the csdn blog, reprinted please indicate the source: http://blog.csdn.net/seraphlei/archive/2008/11/17/3320484.aspx

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.