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