mysql数据库无法运行分页的列表视图 [英] list view with mysql database not working paging

查看:93
本文介绍了mysql数据库无法运行分页的列表视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好......
我有ListView控制,例如:

hi all....
i have ListView Contol LIke This:

<asp:DataPager ID="DataPager1" runat="server" PagedControlID="ListView1" PageSize="5">
                                   <Fields>
                                       <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" ShowLastPageButton="True" />
                                   </Fields>
                               </asp:DataPager>
                               <asp:ListView ID="ListView1" runat="server">
                                   <LayoutTemplate>
                                       <table border="0px" width="700px" cellspacing='0px' cellpadding="0px">
                                           <tr id="itemPlaceholder" runat="server">
                                           </tr>
                                       </table>
                                   </LayoutTemplate>
                                   <ItemTemplate>
                                       <tr style="background-color: #A52A2A; color: White; text-indent: 20px;">
                                           <td align="left">
                                               <asp:Label runat="server" ID="lblId"><%# Eval("name") %></asp:Label>
                                           </td>
                                           <td align="right">
                                               <asp:Label runat="server" ID="lblName"><%#Eval("schdule")%></asp:Label>
                                           </td>
                                       </tr>
                                       <tr>
                                           <td colspan='2' style="text-indent: 10px;">
                                               <asp:Label runat="server" ID="lblName1"><%#Eval("message")%></asp:Label>
                                               <br />
                                               <br />
                                               <br />
                                           </td>
                                       </tr>
                                   </ItemTemplate>
                                   <SelectedItemTemplate>
                                       <tr runat="server" style="background-color: Yellow;">
                                           <td align="left">
                                               <asp:Label runat="server" ID="lblId1"><%#Eval("name") %></asp:Label>
                                           </td>
                                           <td align="right">
                                               <asp:Label runat="server" ID="lblName2"><%#Eval("schdule")%></asp:Label>
                                           </td>
                                       </tr>
                                   </SelectedItemTemplate>
                               </asp:ListView>


当我单击下一步"按钮分页不起作用时,如何使DataPager与mysql数据库一起使用以进行listview可以有人帮助我吗?
在此先谢谢您


When i Clicking Next Button Paging not working how can i make DataPager to work with mysql database for listview can any one please help me
Thank You in Advance

推荐答案

要使分页正常工作,重要的是请求当前页面并查找有多少页面的SQL.您在这里不显示任何SQL.让控件进行分页但将所有数据保存在内存中是很疯狂的.我认为您没有这样做.所有控件工作正常.他们并不关心您拥有的数据库,只要您正确查询数据即可.获取数据的方式很可能是我们了解您正在做的事情和需要做的事情所需要的信息.您还应该定义不起作用".您可以一次查看所有记录吗?您是否看到第1页,但其他页面链接不起作用?您是否看到一页的记录并且没有分页链接?
For paging to work, what matters is the SQL that requests the current page and also finds out how many pages there are. You don''t show any SQL here. Getting a control to do paging but hold all your data in memory is insanity. I assume that you''re not doing that. All the controls work fine. They don''t care what DB you have, so long as you query it for the data properly. The way you get your data is mostly likely the information we need to understand what you''re doing, and what you need to do. You should also define ''not working''. Do you see all your records at once ? Do you see page 1, but the other page links don''t work ? Do you see the records for one page and no paging links ?


这篇关于mysql数据库无法运行分页的列表视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆