asp.net listview datapager 和 jquery

发布于 2024-12-07 15:18:47 字数 4740 浏览 0 评论 0原文

我有一个通过 ajax 调用调用的 Asp.net Listview 控件。 Listview 控件每个视图只有 10 个项目。当我翻阅该内容时,我当然会收到错误,因为它没有该数据。有没有一种方法可以从 ajax 调用获取列表视图,并且仍然能够翻阅项目列表。谢谢!

   <asp:ListView runat="server" ID="lvFullControl" GroupItemCount="5" OnItemCreated="Setup">
            <EmptyDataTemplate>
                <table id="Table1" runat="server" style="">
                    <tr>
                        <td>
                            No data was returned.
                        </td>
                    </tr>
                </table>
            </EmptyDataTemplate>
            <EmptyItemTemplate>
                <td id="Td1" runat="server" />
            </EmptyItemTemplate>
            <GroupTemplate>
                <tr id="itemPlaceholderContainer" runat="server">
                    <td id="itemPlaceholder" runat="server">
                    </td>
                </tr>
            </GroupTemplate>
            <ItemTemplate>
                <td id="Td2" runat="server" style="display: inline-block; position: relative; margin: 0.7em;
                    text-align: left; vertical-align: top;">
                    <div id="HypeShare" style="padding: 0; margin: 0">
                        <input type="hidden" value="<%#Eval("ID") %>" />
                        <asp:HyperLink runat="server" ID="hypShar"></asp:HyperLink>
                         <input type="hidden" value="<%#Eval("CreatD") %>"/>
                         </div>
                    <div class="EditClass">
                        <asp:ImageButton ToolTip='<%#Eval("Description") %>' runat="server" ID="AlbumImage" Width="110"
                            Height="110" ImageUrl='<%#Eval("Defau") %>' /></div>
                    <img src="../SiteImages/private.png" style="margin: 0" />
                    <span style="margin: 0">photos:
                        <%#Eval("Count")%></span><br />
                    <div id="hypAccess" style="padding: 0; margin: 0">
                        <input type="hidden" value="<%#Eval("ID") %>" />
                        <asp:HyperLink runat="server" ID="hypeDelet" Visible="false" Text="Delete"></asp:HyperLink>
                        <asp:HyperLink ID="hypeMyAccess" runat="server" Visible="false" Text="Remove my Access"></asp:HyperLink>

                    </div>
                    <div  class="EditClass">
                        <asp:HyperLink runat="server" ID="Edit" ToolTip='<%#Eval("Description") %>' Font-Underline="false">
                        <p class="title" runat="server" id="pTitle">
                            <%#Eval("Name") %></p>
                    </asp:HyperLink></div>
                </td>
            </ItemTemplate>
            <LayoutTemplate>
                <table id="Table2" runat="server">
                    <tr id="Tr1" runat="server">
                        <td id="Td3" runat="server">
                            <table id="groupPlaceholderContainer" runat="server" border="0" style="">
                                <tr id="groupPlaceholder" runat="server">
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr id="Tr2" runat="server">
                        <td id="Td4" runat="server" style="">
                        </td>
                    </tr>
                </table>
            </LayoutTemplate>
        </asp:ListView>
        <asp:DataPager ID="ProductListPagerSimple" runat="server"

PagedControlID="lvFull" PageSize="10">

 function GetFullA() {
            $.ajax({
                type: "GET",
                url: '../Controls/myfullcontrol.aspx',
                cache: false,
                success: function (data) {
                    $('#SiteFullControl').html(data);
                },
                complete: function () {
                    $('#FullControlCount').html('Full Control  (' + $('[id$=FullCounter]').val() + ')');
                    setupAccessInfo();
                    setupShareAccess();
                    menuFullControlSetup($('#nav-myfullcontrol'));
                        $('#LoadingAjax').dialog('close');
                        destroyDialog = false;
                }

            });
        }

I have a Asp.net Listview control that is being called through an ajax call. The Listview control only has 10 items per view. When I page through that I get a error of course because it does not have that data. Is there a way to get a listview from a ajax call and still be able to page through the list of items. Thanks!

   <asp:ListView runat="server" ID="lvFullControl" GroupItemCount="5" OnItemCreated="Setup">
            <EmptyDataTemplate>
                <table id="Table1" runat="server" style="">
                    <tr>
                        <td>
                            No data was returned.
                        </td>
                    </tr>
                </table>
            </EmptyDataTemplate>
            <EmptyItemTemplate>
                <td id="Td1" runat="server" />
            </EmptyItemTemplate>
            <GroupTemplate>
                <tr id="itemPlaceholderContainer" runat="server">
                    <td id="itemPlaceholder" runat="server">
                    </td>
                </tr>
            </GroupTemplate>
            <ItemTemplate>
                <td id="Td2" runat="server" style="display: inline-block; position: relative; margin: 0.7em;
                    text-align: left; vertical-align: top;">
                    <div id="HypeShare" style="padding: 0; margin: 0">
                        <input type="hidden" value="<%#Eval("ID") %>" />
                        <asp:HyperLink runat="server" ID="hypShar"></asp:HyperLink>
                         <input type="hidden" value="<%#Eval("CreatD") %>"/>
                         </div>
                    <div class="EditClass">
                        <asp:ImageButton ToolTip='<%#Eval("Description") %>' runat="server" ID="AlbumImage" Width="110"
                            Height="110" ImageUrl='<%#Eval("Defau") %>' /></div>
                    <img src="../SiteImages/private.png" style="margin: 0" />
                    <span style="margin: 0">photos:
                        <%#Eval("Count")%></span><br />
                    <div id="hypAccess" style="padding: 0; margin: 0">
                        <input type="hidden" value="<%#Eval("ID") %>" />
                        <asp:HyperLink runat="server" ID="hypeDelet" Visible="false" Text="Delete"></asp:HyperLink>
                        <asp:HyperLink ID="hypeMyAccess" runat="server" Visible="false" Text="Remove my Access"></asp:HyperLink>

                    </div>
                    <div  class="EditClass">
                        <asp:HyperLink runat="server" ID="Edit" ToolTip='<%#Eval("Description") %>' Font-Underline="false">
                        <p class="title" runat="server" id="pTitle">
                            <%#Eval("Name") %></p>
                    </asp:HyperLink></div>
                </td>
            </ItemTemplate>
            <LayoutTemplate>
                <table id="Table2" runat="server">
                    <tr id="Tr1" runat="server">
                        <td id="Td3" runat="server">
                            <table id="groupPlaceholderContainer" runat="server" border="0" style="">
                                <tr id="groupPlaceholder" runat="server">
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr id="Tr2" runat="server">
                        <td id="Td4" runat="server" style="">
                        </td>
                    </tr>
                </table>
            </LayoutTemplate>
        </asp:ListView>
        <asp:DataPager ID="ProductListPagerSimple" runat="server"

PagedControlID="lvFull" PageSize="10">

 function GetFullA() {
            $.ajax({
                type: "GET",
                url: '../Controls/myfullcontrol.aspx',
                cache: false,
                success: function (data) {
                    $('#SiteFullControl').html(data);
                },
                complete: function () {
                    $('#FullControlCount').html('Full Control  (' + $('[id$=FullCounter]').val() + ')');
                    setupAccessInfo();
                    setupShareAccess();
                    menuFullControlSetup($('#nav-myfullcontrol'));
                        $('#LoadingAjax').dialog('close');
                        destroyDialog = false;
                }

            });
        }

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文