Differences between eval and databinder. Eval

Source: Internet
Author: User
Differences between eval and databinder. Eval

Basic Format of databinder. Eval
Databinder. eval (container. dataitem, "XXX", "{0 }")
<% #
Databinder. eval (container. dataitem, "XXXX") %> or <% #
Databinder. eval (container, "dataitem. XXXX") %>
Another method is said to be highly efficient by Microsoft.
<% #
(Datarowview) container. dataitem) ["XXXX"] %>
However, this method must be used to import the namespace system. Data on the foreground page. Otherwise, an error message <% @ import namespace = "system. Data" is generated"
%>

 

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?
Problem 3: databinder. eval (container. dataitem ,"")
What are the container and dataitem respectively?

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") %>

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.