noeternal 2019-04-02 11:42 采纳率: 20%
浏览 207

Repeater控件不能显示数据,求指点QAQ

初始化页面时给Repeater赋值时能在前台显示的,后台数据源数据也都没有问题,
再给Repeater控件绑定数据源并赋值后会进入override VerifyRenderingInServerForm方法,前台不能显示数据,
有人说在前台<%@ Page Language="C#" …… EnableEventValidation="false" %>加上EnableEventValidation="false",可是没用,求指点,已经研究好久了气哭
后台:(GridView控件也绑定了一个数据源)

 RepeaterList.DataSource = dt; (dt是一个表格,有值)
 RepeaterList.DataBind();
 public override void VerifyRenderingInServerForm(System.Web.UI.Control control)
 { }

前台:

 <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table cellpadding="0" cellspacing="0" width="100%" border="0" style="margin: 10px 0;">
              <tr>
                        <th> 姓名Name</th>
                        <th>性别Gender</th>
                        <th>年龄Age</th>
                        <th>删除Delete</th>
              </tr>
<asp:Repeater ID="RepeaterList" runat="server" OnItemCommand="RpProduct_ItemCommand">
       <ItemTemplate>
           <tr>
             <td >
                       <asp:TextBox ID="TxtSKU"   runat="server" class="atext" Text='<%# Eval("Name")%>'></asp:TextBox>
             </td>
             <td>
                      <asp:TextBox ID="TxtNewSKU" runat="server" class="atext"  Text='<%# Eval("Gender")%>'></asp:TextBox>
                </td>
               <td>
                       <asp:TextBox ID="TxtQuantity"  runat="server" class="atext" Text='<%# Eval("Age")%>'></asp:TextBox>
                </td>
                <td>
                 <span>
                        asp:LinkButton ID="lbDel" CommandName="btndel" runat="server" OnClientClick="return confirm( '确定要删除吗(Are you sure delete it)? ');">Del</asp:LinkButton></span>
                </td>
           </tr>
          </ItemTemplate>
</asp:Repeater>
</table>
</ContentTemplate>
 </asp:UpdatePanel>
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
    • ¥15 如何在scanpy上做差异基因和通路富集?
    • ¥20 关于#硬件工程#的问题,请各位专家解答!
    • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
    • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
    • ¥30 截图中的mathematics程序转换成matlab
    • ¥15 动力学代码报错,维度不匹配
    • ¥15 Power query添加列问题
    • ¥50 Kubernetes&Fission&Eleasticsearch
    • ¥15 報錯:Person is not mapped,如何解決?