什么是标准的ASP.net数据绑定语法?
发布时间:2020-12-16 03:27:24 所属栏目:asp.Net 来源:网络整理
导读:Microsoft对 data-binding using the asp:Repeater 控件的介绍给出了获取值的语法: b%# DataBinder.Eval(Container.DataItem,"orderid") %/b 此语法在other introductions to the ASP.net Repeater control重复: a href="%# DataBinder.Eval(Container.Dat
Microsoft对
data-binding using the
asp:Repeater 控件的介绍给出了获取值的语法:
<b><%# DataBinder.Eval(Container.DataItem,"orderid") %></b> 此语法在other introductions to the ASP.net <a href="<%# DataBinder.Eval(Container.DataItem,"URL") %>">...</a> 但我记得这种语法是“坏”和“错误”.从
(重点补充) 这就解释了为什么我记得“Eval很糟糕”.但什么是“标准的ASP.NET数据绑定语法”? 奖金阅读 > Data-Binding Expression Syntax 解决方法
我认为你可以做一个演员以避免“后期绑定”惩罚:
<%# (((System.Data.DataRowView)Container.DataItem)["URL"]) %> 现在让我们假设您将性能提高x%.你的申请值得吗?权衡(在我看来)是可读性较差. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- 适用于ASP.NET Core 2的MultipartFormDataStreamProvider
- asp.net-mvc – 将依赖项注入验证属性Web Api Asp.Net Core
- asp.net-core – 如何获取有关运行时.Net Core的信息
- ASP.NET Core根据环境切换NLog配置
- asp.net – 当引发CacheItemRemovedCallback时,HttpContext
- asp.net mvc 设置一个action的访问人数,达到上线排队
- Asp.Net:在iis中调试网站
- asp.net – 要排除的Nuget和源控制文件?
- 【译】ASP.NET Core在 .NET Core 3.1 Preview 1中的更新
- asp.net – 发布网站项目时Temp路径太长