ASp.Net中继器控制: error showing on binding repeater

标签 asp.net .net

它显示错误“不可调用的成员'System.Web.UI.WebControls.RepeaterItem.DataItem'不能像方法一样使用。

对于 <%# Container.DataItem("CostPageDescription")%>

我的代码如下,

                 <td> Cost Page Description</td>
                 <td> Vendor Name</td>
                 <td> Bill Type</td>
             </tr>
      </HeaderTemplate>
      <ItemTemplate>
         <tr>
               <td> <%# Container.DataItem("CostPageDescription")%></td>
               <td> <%# Container.DataItem("VendorName")%> </td>
               <td> <%# Container.DataItem("BillType") %> </td>
         </tr>
         <tr>

最佳答案

像这样使用

<td> <%# eval("CostPageDescription")%></td>

在一个地方你留空了,所以请正确填写

关于ASp.Net中继器控制: error showing on binding repeater,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17431667/

相关文章:

asp.net - 如何让 Url.Action 使用正确的端口号?

c# - 是否可以在 .Net 3.5 中制作的 asp.net core 2.0 中加载程序集

c# - 如何以及何时翻译和评估 LINQ 查询?

c# - 如何结合 ListBox、TextBox 和 Button 创建 asp.net 应用程序

c# - .net 页面无故加载两次

c# - Entity Framework 查询多对多关系

c# - 面试失败 : And I thought Google was tough

c# - Hangfire 和 VB.NET - 获取应用程序启动类中配置的内容

c# - 何时应使用引用以及何时应使用项目引用

c# - 如何在不使用类别的情况下在属性网格中添加组?