加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

ASP.NET:开始<%%>的'#'是什么意思?

发布时间:2020-12-16 04:20:56 所属栏目:asp.Net 来源:网络整理
导读:我一直在asp.net中使用转发器控件已经有一段时间了……我时不时地忘记在内部添加'#'了. %#DataBinder.Eval(Container.DataItem,“NAME”)% 所以我想知道它是什么意思? 解决方法 它表示您是 binding an expression,因此您演示了eval或bind. 数据绑定语法 D
我一直在asp.net中使用转发器控件已经有一段时间了……我时不时地忘记在<内部添加'#'了. %#DataBinder.Eval(Container.DataItem,“NAME”)%>

所以我想知道它是什么意思?

解决方法

它表示您是 binding an expression,因此您演示了eval或bind.

数据绑定语法

Data-binding expressions are contained within <%# and %> delimiters and use the Eval and Bind functions. The Eval function is used to define one-way (read-only) binding. The Bind function is used for two-way (updatable) binding. In addition to calling Eval and Bind methods to perform data binding in a data-binding expression,you can call any publicly scoped code within the <%# and %> delimiters to execute that code and return a value during page processing.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读