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

前端之家收集整理的这篇文章主要介绍了ASP.NET:开始<%%>的'#'是什么意思?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我一直在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.

猜你在找的asp.Net相关文章