Databinder. Eval Method

Source: Internet
Author: User

Databinder. Eval Method

1. Basic Format of databinder. Eval

This sentence is often used when binding data.Program: Or

Today I learned anotherAnd Microsoft also said that this method is more efficient than the above two methods.

Very useful, so that you can do a lot of things on the front-end page.

Remember to import the namespace system. Data on the front-end page. Otherwise, an error message is generated.

In factIt is a truth.

TEXT =''This method is the fastest

TEXT =''You can also bind a method, but the method is public

TEXT =''You can also connect multiple fields.

The key is the container, which is mysterious. Its namespace is system. componentmodel. I need to further understand it.

2. Determine and select databinder. Eval

. Aspx



. CS defines the toformatsex Method
Protected string toformatsex (string sex)
{
If (XB = "1 ")
Return "male ";
Else
Return "female ";
}

Iii. Example of databinder. Eval usage

Show two decimal places


Alternatetext =''
Imageurl = ''/>

Conversion Type
(String) databinder. eval (container, "dataitem. p_ship_time_sbm8"). substring (4, 4)

Appendix:

{0: F2} displays two decimal places

{0: g}: display true or false

{0: d}

Date only displays year, month, and day

{0: yyyy-mm-dd} year by 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.