【问题标题】:Repeater in updatepanel not showing rows correctly更新面板中的中继器未正确显示行
【发布时间】:2012-05-20 17:04:30
【问题描述】:

我有一个有 500 行的表。首先,我在负载上绑定了转发器来测试表格的输出,表格显示完美。但我的主要目的是在更新面板中使用中继器,所以一旦用户点击显示,更新面板显示显示 500 行表。该表显示,但由于某种原因,某些列在 Internet Explorer 9 中随机排列错误。我在 Firefox 中进行了测试,它似乎渲染得很好。

有什么想法吗?

这是我使用的一些 sn-p 代码..

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
        <asp:LinkButton ID="lnkbreakdown" runat="server" OnClick="lnkbreakdown_Click">Show Breakdown</asp:LinkButton>
        <asp:Repeater ID="tblstatementhistory" runat="server">
            <FooterTemplate>
                </table>
                <br />
            </FooterTemplate>
            <HeaderTemplate>
                <table cellpadding="5" cellspacing="0" id="tblstatementhistory" style="margin-left: 3px;">
                    <tr>
                        <th>
                            Worker Name
                        </th>
                        <th>
                            Reference No.
                        </th>
                        <th class="smallcolumn">
                            Method
                        </th>
                        <th>
                            Sent On
                        </th>
                        <th class="largecolumn">
                            Delivery Status
                        </th>
                    </tr>
            </HeaderTemplate>
            <ItemTemplate>
                <tr>
                    <td><%# Container.DataItem("fullname")%>&nbsp;</td><%# vbCrLf%>
                    <td><%# Container.DataItem("xxh")%>&nbsp;</td><%# vbCrLf%>
                    <td><%# getMethod(CheckDBNull(Container.DataItem("EMAILID"), enumObjectType.IntType), CheckDBNull(Container.DataItem("POSTEDID"), enumObjectType.IntType))%>&nbsp;</td><%# vbCrLf%>
                    <td><%# getStatus(CheckDBNull(Container.DataItem("email_ts")), CheckDBNull(Container.DataItem("post_ts")))%>&nbsp;</td><%# vbCrLf%>
                    <td><%# getdelivery(CheckDBNull(Container.DataItem("status"), enumObjectType.IntType), CheckDBNull(Container.DataItem("timestampupdate")), CheckDBNull(Container.DataItem("email_ts")), CheckDBNull(Container.DataItem("post_ts")))%>&nbsp;</td><%# vbCrLf%>
                 </tr>
            </ItemTemplate>
        </asp:Repeater>
    <ContentTemplate>
</asp:UpdatePanel>

【问题讨论】:

    标签: asp.net .net updatepanel repeater


    【解决方案1】:

    在运行回发时,它似乎是 IE 的渲染/开销。我现在已经将我的方法从使用 asp.net updatepanel 更改为使用带有 JSON 的 jquery。这现在检索我的数据,并且没有任何未对齐的行/列。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-03-02
      • 2018-02-17
      • 2023-03-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多