什么是在asp.net中使用eval()的 [英] what is the use of Eval() in asp.net

查看:79
本文介绍了什么是在asp.net中使用eval()的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

谁能告诉我,什么是asp.net中使用eval()以及它是如何有用?

can anyone let me know, what is the use of Eval() in asp.net and how it is usefull?

推荐答案

评估用于绑定到已设置成为一个UI项只读(例如:标签或只读文本框),也就是说,的eval用于单程结合 - 用于从数据库中读取到UI字段

Eval is used to bind to an UI item that is setup to be read-only (eg: a label or a read-only text box), i.e., Eval is used for one way binding - for reading from a database into a UI field.

它一般用于后期绑定的数据(而不是从开始就知道),通常绑定到包含整个记录中的数据绑定控件的最小组成部分。 Eval方法需要一个数据字段的名称,并返回一个包含该字段的数据源中的当前记录中的值的字符串。你可以提供一个可选的第二个参数来指定返回的字符串的格式。字符串格式参数使用为String类的Format方法定义的语法。

It is generally used for late-bound data (not known from start) and usually bound to the smallest part of the data-bound control that contains a whole record. The Eval method takes the name of a data field and returns a string containing the value of that field from the current record in the data source. You can supply an optional second parameter to specify a format for the returned string. The string format parameter uses the syntax defined for the Format method of the String class.

这篇关于什么是在asp.net中使用eval()的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆