Leisurely self-eval () and databinder. eval () methods in ASP. NET
Eval ("") and bind ("") one-way binding and one-way binding
BIND is a two-way binding, but can be used only when the data source can be changed
ASP. NET 2.0 improves the Data
Like many other explanatory languages, JavaScript can also interpret strings that run from JavaScript source code and produce a value. JavaScript uses the global function eval () to do this work
Eval ("1+2"),-> 3Dynamically judging the strings in
ASP. NET Eval can be used for database binding. However, the specific operations seem complicated. Next we will introduce a method for ASP. NET Eval to help write database binding expressions.
ASP. NET Eval method is TemplateControl, while System.
ASP. NET 2.0 improves the Data Binding operation in the template. It simplifies the Data Binding syntax databinder. eval (container. dataitem, fieldname) in v1.x to eval (fieldname ). The eval method, like databinder. Eval, can accept an optional
1. Bind isBidirectional data binding, Will change only when there is a data source.
2. In net1.x, there are databinder (container. dataitem, "data item ")One-way Data Binding
. Net2.x is simplified to eval ("data item ");
The difference
Differences and usage of data formatting-eval ("") and databinder. eval (container. dataitem, "")
ASP. NET 2.0 improves the Data Binding operation in the template. It simplifies the Data Binding syntax databinder. eval (container. dataitem,
In fact, the Eval method is TemplateControl, while the System. web. UI. page and System. web. UI. userControl inherits from TemplateControl, so we can directly call a method on Page and UserControl.
The Page. Eval method can help us better write
Eval () methodDuring runtime, reflection is used to perform post-binding computation. Therefore, compared with the standard ASP. NET data binding method bind, performance will be significantly reduced. It is generally used to format strings when
ASP. NET 2.0 improves the Data Binding operation in the template. It simplifies the Data Binding syntax databinder. eval (container. dataitem, fieldname) in v1.x to eval (fieldname ). The eval method, like databinder. Eval, can accept an optional
Eval () methodLate-bound calculations are performed using reflection at run time, so performance is significantly reduced compared to the standard ASP. NET data binding method. It is typically used when binding requires formatting a string. Use this
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.