如何实现ListView高效分页代码

  View Code

  <% @ Page Language="C#" AutoEventWireup="true" CodeBehind="ListView.aspx.cs" Inherits ="WebForm.ListView" %>

  

  < html xmlns ="http://www.w3.org/1999/xhtml">

  < head runat ="server">

  </ title></p> <p>  </ head></p> <p>  < body></p> <p>  <form id="form1" runat="server"></p> <p>  <div ></p> <p>  < asp: ObjectDataSource ID ="ObjectDataSource1" runat ="server"</p> <p>  SelectMethod ="getPageListByPage" TypeName ="BLL.Classes"</p> <p>  DataObjectTypeName ="MODEL.Classes" DeleteMethod ="SoftDel" InsertMethod ="Add"</p> <p>  UpdateMethod ="Modify" EnablePaging ="True"</p> <p>  MaximumRowsParameterName ="rowIndex" SelectCountMethod ="GetTotalRowsCount"</p> <p>  StartRowIndexParameterName ="pageSize"></p> <p>  </ asp: ObjectDataSource ></p> <p>  < asp: ListView ID ="ListView1" runat ="server" DataSourceID ="ObjectDataSource1"</p> <p>  InsertItemPosition ="LastItem"></p> <p>  < AlternatingItemTemplate></p> <p>  < tr style =""></p> <p>  < td></p> <p>  < asp: Button ID ="DeleteButton" runat ="server" CommandName ="Delete" Text ="删除" /></p> <p>  < asp: Button ID ="EditButton" runat ="server" CommandName ="Edit" Text ="编辑" /></p> <p>  </ td></p> <p>  < td></p> <p>  < asp: Label ID ="CIDLabel" runat ="server" Text =' <%# Eval("CID") %> ' /></p> <p>  </ td></p> <p>  < td></p> <p>  < asp: Label ID ="CNameLabel" runat ="server" Text =' <%# Eval("CName") %> ' /></p> <p>  </ td></p> <p>  < td></p> <p>  < asp: Label ID ="CCountLabel" runat ="server" Text =' <%# Eval("CCount") %> ' /></p> <p>  </ td></p> <p>  < td></p> <p>  < asp: Label ID ="CImgLabel" runat ="server" Text =' <%# Eval("CImg") %> ' /></p> <p>  </ td></p> <p>  < td></p> <p>  < asp: CheckBox ID ="CIsDelCheckBox" runat ="server"</p> <p>  Checked ='<% # Eval("CIsDel") %> ' Enabled ="false" /></p> <p>  </ td></p> <p>  < td></p> <p>  < asp: Label ID ="CAddTimeLabel" runat ="server" Text =' <%# Eval("CAddTime") %> ' /></p> <p>  </ td></p> <p>  </ tr></p> <p>  </ AlternatingItemTemplate></p> <p>  < EditItemTemplate></p> <p>  < tr style =""></p> <p>  < td></p> <p>  < asp: Button ID ="UpdateButton" runat ="server" CommandName ="Update" Text ="更新" /></p> <p>  < asp: Button ID ="CancelButton" runat ="server" CommandName ="Cancel" Text ="取消" /></p> <p>  </ td></p> <p>  < td></p> <p>  < asp: TextBox ID ="CIDTextBox" runat ="server" Text =' <%# Bind("CID") %> ' /></p> <p>  </ td></p> <p>  < td></p> <p>  < asp: TextBox ID ="CNameTextBox" runat ="server" Text =' <%# Bind("CName") %> ' /></p> <p>  </ td></p> <p>  < td></p> <p>  < asp: TextBox ID ="CCountTextBox" runat ="server" Text =' <%# Bind("CCount") %> ' /></p> <p>  </ td></p> <p>  < td></p> <p>  < asp: TextBox ID ="CImgTextBox" runat ="server" Text =' <%# Bind("CImg") %> ' /></p> <p>  </ td></p> <p>  < td></p> <p>  < asp: CheckBox ID ="CIsDelCheckBox" runat ="server"</p> <p>  Checked ='<% # Bind("CIsDel") %> ' /></p> <p>  </ td></p> <p>  < td></p> <p>  < asp: TextBox ID ="CAddTimeTextBox" runat ="server"</p> <p>  Text ='<% # Bind("CAddTime") %> ' /></p> <p>  </ td></p> <p>  </ tr></p> <p>  </ EditItemTemplate></p> <p>  < EmptyDataTemplate></p> <p>  < table runat ="server"</p> <p>  style =""></p> <p>  < tr></p> <p>  < td></p> <p>  未返回数据。 </ td></p> <p>  </ tr></p> <p>  </ table></p> <p>  </ EmptyDataTemplate></p> <p>  < InsertItemTemplate></p> <p>  < tr style =""></p> <p>  < td></p> <p>  < asp: Button ID ="InsertButton" runat ="server" CommandName ="Insert" Text ="插入" /></p> <p>  < asp: Button ID ="CancelButton" runat ="server" CommandName ="Cancel" Text ="清除" /></p> <p>  </ td></p> <p>  < td></p> <p>  < asp: TextBox ID ="CIDTextBox" runat ="server" Text =' <%# Bind("CID") %> ' /></p> <p>  </ td></p> <p>  < td></p> <p>  < asp: TextBox ID ="CNameTextBox" runat ="server" Text =' <%# Bind("CName") %> ' /></p> <p>  </ td></p> <p>  < td></p> <p>  < asp: TextBox ID ="CCountTextBox" runat ="server" Text =' <%# Bind("CCount") %> ' /></p> <p>  </ td></p> <p>  < td></p> <p>  < asp: TextBox ID ="CImgTextBox" runat ="server" Text =' <%# Bind("CImg") %> ' /></p> <p>  </ td></p> <p>  < td></p> <p>  < asp: CheckBox ID ="CIsDelCheckBox" runat ="server"</p> <p>  Checked ='<% # Bind("CIsDel") %> ' /></p> <p>  </ td></p> <p>  < td></p> <p>  < asp: TextBox ID ="CAddTimeTextBox" runat ="server"</p> <p>  Text ='<% # Bind("CAddTime") %> ' /></p> <p>  </ td></p> <p>  </ tr></p> <p>  </ InsertItemTemplate></p> <p>  < ItemTemplate></p> <p>  < tr style =""></p> <p>  < td></p> <p>  < asp: Button ID ="DeleteButton" runat ="server" CommandName ="Delete" Text ="删除" /></p> <p>  < asp: Button ID ="EditButton" runat ="server" CommandName ="Edit" Text ="编辑" /></p> <p>  </ td></p> <p>  < td></p> <p>  < asp: Label ID ="CIDLabel" runat ="server" Text =' <%# Eval("CID") %> ' /></p> <p>  </ td></p> <p>  < td></p> <p>  < asp: Label ID ="CNameLabel" runat ="server" Text =' <%# Eval("CName") %> ' /></p> <p>  </ td></p> <p>  < td></p> <p>  < asp: Label ID ="CCountLabel" runat ="server" Text =' <%# Eval("CCount") %> ' /></p> <p>  </ td></p> <p>  < td></p> <p>  < asp: Label ID ="CImgLabel" runat ="server" Text =' <%# Eval("CImg") %> ' /></p> <p>  </ td></p> <p>  < td></p> <p>  < asp: CheckBox ID ="CIsDelCheckBox" runat ="server"</p> <p>  Checked ='<% # Eval("CIsDel") %> ' Enabled ="false" /></p> <p>  </ td></p> <p>  < td></p> <p>  < asp: Label ID ="CAddTimeLabel" runat ="server" Text =' <%# Eval("CAddTime") %> ' /></p> <p>  </ td></p> <p>  </ tr></p> <p>  </ ItemTemplate></p> <p>  < LayoutTemplate></p> <p>  < table runat ="server"></p> <p>  < tr runat ="server"></p> <p>  < td runat ="server"></p> <p>  < table ID ="itemPlaceholderContainer" runat ="server" border ="0"</p> <p>  style =""></p> <p>  < tr runat ="server" style =""></p> <p>  < th runat ="server"></p> <p>  </ th></p> <p>  < th runat ="server"></p> <p>  CID </ th></p> <p>  < th runat ="server"></p> <p>  CName </ th></p> <p>  < th runat ="server"></p> <p>  CCount </ th></p> <p>  < th runat ="server"></p> <p>  CImg </ th></p> <p>  < th runat ="server"></p> <p>  CIsDel </ th></p> <p>  < th runat ="server"></p> <p>  CAddTime </ th></p> <p>  </ tr></p> <p>  < tr ID ="itemPlaceholder" runat ="server"></p> <p>  </ tr></p> <p>  </ table></p> <p>  </ td></p> <p>  </ tr></p> <p>  < tr runat ="server"></p> <p>  < td runat ="server"</p> <p>  style =""></p> <p>  </ td></p> <p>  </ tr></p> <p>  </ table></p> <p>  </ LayoutTemplate></p> <p>  < SelectedItemTemplate></p> <p>  < tr style =""></p> <p>  < td></p> <p>  < asp: Button ID ="DeleteButton" runat ="server" CommandName ="Delete" Text ="删除" /></p> <p>  < asp: Button ID ="EditButton" runat ="server" CommandName ="Edit" Text ="编辑" /></p> <p>  </ td></p> <p>  < td></p> <p>  < asp: Label ID ="CIDLabel" runat ="server" Text =' <%# Eval("CID") %> ' /></p> <p>  </ td></p> <p>  < td></p> <p>  < asp: Label ID ="CNameLabel" runat ="server" Text =' <%# Eval("CName") %> ' /></p> <p>  </ td></p> <p>  < td></p> <p>  < asp: Label ID ="CCountLabel" runat ="server" Text =' <%# Eval("CCount") %> ' /></p> <p>  </ td></p> <p>  < td></p> <p>  < asp: Label ID ="CImgLabel" runat ="server" Text =' <%# Eval("CImg") %> ' /></p> <p>  </ td></p> <p>  < td></p> <p>  < asp: CheckBox ID ="CIsDelCheckBox" runat ="server"</p> <p>  Checked ='<% # Eval("CIsDel") %> ' Enabled ="false" /></p> <p>  </ td></p> <p>  < td></p> <p>  < asp: Label ID ="CAddTimeLabel" runat ="server" Text =' <%# Eval("CAddTime") %> ' /></p> <p>  </ td></p> <p>  </ tr></p> <p>  </ SelectedItemTemplate></p> <p>  </ asp: ListView ></p> <p>  </div ></p> <p>  <asp : DataPager ID ="DataPager1" runat ="server" PagedControlID ="ListView1"</p> <p>  PageSize ="5"></p> <p>  < Fields></p> <p>  < asp: NextPreviousPagerField ButtonType ="Button" ShowFirstPageButton ="True"</p> <p>  ShowLastPageButton ="True" /></p> <p>  </ Fields></p> <p>  </asp : DataPager></p> <p>  </form ></p> <p>  </ body></p> <p>  </ html></p> <div class="art_xg"> <b>您可能感兴趣的文章:</b> <ul> <li><a href="/houfang/19993.html" title="好听有寓意的贸易公司名字" target="_blank">好听有寓意的贸易公司名字</a></li> <li><a href="/shangbei/20476.html" title="DNF前往绝密区域任务怎么做 dnf前往绝密区域任务任务攻略" target="_blank">DNF前往绝密区域任务怎么做 dnf前往绝密区域任务任务攻略</a></li> <li><a href="/shangbei/25160.html" title="DNF混沌骑士二觉全招流刷图加点攻略" target="_blank">DNF混沌骑士二觉全招流刷图加点攻略</a></li> <li><a href="/youdong/33969.html" title="追风小米抢购软件 v2.0 绿色特别版" target="_blank">追风小米抢购软件 v2.0 绿色特别版</a></li> <li><a href="/youdong/35100.html" title="霸气的dnf游戏名字大全" target="_blank">霸气的dnf游戏名字大全</a></li> <li><a href="/qianyuan/32042.html" title="超火的英雄联盟名字2024" target="_blank">超火的英雄联盟名字2024</a></li> <li><a href="/shangbei/35672.html" title="GTA5 第三章 流程图文攻略" target="_blank">GTA5 第三章 流程图文攻略</a></li> <li><a href="/houfang/24031.html" title="张姓男孩好名字" target="_blank">张姓男孩好名字</a></li> <li><a href="/zuoxi/2825.html" title="Android实现仿淘宝购物车增加和减少商品数量功能demo示例" target="_blank">Android实现仿淘宝购物车增加和减少商品数量功能demo示例</a></li> <li><a href="/zuoxi/23448.html" title="天猫捉猫猫抢积分如何玩? 天猫捉猫猫抢积分游戏活动介绍" target="_blank">天猫捉猫猫抢积分如何玩? 天猫捉猫猫抢积分游戏活动介绍</a></li> </ul> </div> </div> <!--endmain--> <div class="tags clearfix"> <i class="icon-tag"></i> </div> <div id="shoucang"></div> <div class="xgcomm clearfix"> <h2>相关文章</h2> <ul> <!--预留空位--> <li><a href="/xianan/19190.html" title="剑灵如何实现双开 剑灵3步程序实现双开" target="_blank">剑灵如何实现双开 剑灵3步程序实现双开</a></li> <li><a href="/shangbei/34830.html" title="golang如何实现proxy代理简单方法" target="_blank">golang如何实现proxy代理简单方法</a></li> <li><a href="/xianan/3752.html" title="c# 如何实现代码生成器" target="_blank">c# 如何实现代码生成器</a></li> <li><a href="/qianyuan/38992.html" title="如何实现ListView高效分页代码" target="_blank">如何实现ListView高效分页代码</a></li> <li><a href="/houfang/36879.html" title="详解Python如何实现发送带附件的电子邮件" target="_blank">详解Python如何实现发送带附件的电子邮件</a></li> <li><a href="/zuoxi/12629.html" title="一行JavaScript代码如何实现瀑布流布局" target="_blank">一行JavaScript代码如何实现瀑布流布局</a></li> <li><a href="/xianan/7256.html" title="Response如何实现重定向" target="_blank">Response如何实现重定向</a></li> <li><a href="/zuoxi/20836.html" title="合约机如何实现机卡分离?两种合约机机卡分离方法详解" target="_blank">合约机如何实现机卡分离?两种合约机机卡分离方法详解</a></li> <li><a href="/qianyuan/1461.html" title="360云盘如何实现全盘共享?360云盘共享文件设置教程" target="_blank">360云盘如何实现全盘共享?360云盘共享文件设置教程</a></li> <li><a href="/qianyuan/3845.html" title="C#之如何实现真正的四舍五入" target="_blank">C#之如何实现真正的四舍五入</a></li> </ul> </div> <div class="lbd clearfix mt5"> <!--预留空位--> </div> </div> <!--endborder--> </div> <!--end fl--> <div class="main-right"> <div id="sidebar-right"> <div class="r300 clearfix"><span id="side_up" class="jbTestPos"><div class="_tzgwhtanot"> <!--预留空位--></div></span></div> <div class="sidebox-recomm"></div> <div class="sidebox bor-blue"> <div class="bor-default pb10"> <h4 class="blue">大家感兴趣的内容</h4> <ul class="newsList newList-in"> <li><a href="/qianyuan/38992.html" title="如何实现ListView高效分页代码" target="_blank">如何实现ListView高效分页代码</a></li> <li><a href="/qianyuan/38987.html" title="详解php如何对数组进行排序" target="_blank">详解php如何对数组进行排序</a></li> <li><a href="/qianyuan/38981.html" title="非主流情侣网名" target="_blank">非主流情侣网名</a></li> <li><a href="/qianyuan/38975.html" title="四个例子说明C语言 全局变量" target="_blank">四个例子说明C语言 全局变量</a></li> <li><a href="/qianyuan/38969.html" title="树莓派.GPRS.短信接收器" target="_blank">树莓派.GPRS.短信接收器</a></li> <li><a href="/qianyuan/38964.html" title="Windows8的Winkey快捷键大全" target="_blank">Windows8的Winkey快捷键大全</a></li> <li><a href="/qianyuan/38958.html" title="网站百度快照时间不更新或倒退怎么办?" target="_blank">网站百度快照时间不更新或倒退怎么办?</a></li> <li><a href="/qianyuan/38952.html" title="windows server 2008 R2利用自带的用Windows Server Backup搞定服务器备份" target="_blank">windows server 2008 R2利用自带的用Windows Server Backup搞定服务器备份</a></li> <li><a href="/qianyuan/38946.html" title="Visual Studio下载_Visual Studio官方下载_Visual Studio安装使用说明" target="_blank">Visual Studio下载_Visual Studio官方下载_Visual Studio安装使用说明</a></li> <li><a href="/qianyuan/38936.html" title="辐射4全35套动力装甲地点图文详解 含传奇部件获得方法" target="_blank">辐射4全35套动力装甲地点图文详解 含传奇部件获得方法</a></li> </ul> </div> </div> <div class="r300 clearfix mt10"><span id="idctu" class="jbTestPos"><div class="_o39regrbj5h"> <!--预留空位--></div> </span></div> <div class="sidebox bor-blue"> <div class="bor-default pb10"> <h4 class="blue">最近更新的内容</h4> <ul class="newsListA"> <li><a href="/youdong/38996.html" title="打开Win7系统nrg文件的方法" target="_blank">打开Win7系统nrg文件的方法</a></li> <li><a href="/houfang/38995.html" title="托卡美发沙龙4最新版 for Android v2.4 安卓手机版" target="_blank">托卡美发沙龙4最新版 for Android v2.4 安卓手机版</a></li> <li><a href="/xianan/38994.html" title="电脑爱好者 2012年第12期 PDF高清版[34.1M]" target="_blank">电脑爱好者 2012年第12期 PDF高清版[34.1M]</a></li> <li><a href="/zuoxi/38993.html" title="魔兽世界怀旧服冰刺长矛任务怎么做 联盟/部落冰刺长矛任务流程攻略" target="_blank">魔兽世界怀旧服冰刺长矛任务怎么做 联盟/部落冰刺长矛任务流程攻略</a></li> <li><a href="/qianyuan/38992.html" title="如何实现ListView高效分页代码" target="_blank">如何实现ListView高效分页代码</a></li> <li><a href="/shangbei/38991.html" title="PCAnyWhere v10.5.1 简体中文版(远程控制软件)" target="_blank">PCAnyWhere v10.5.1 简体中文版(远程控制软件)</a></li> <li><a href="/youdong/38990.html" title="使用PHP和SQLite实现Web套件和CMS" target="_blank">使用PHP和SQLite实现Web套件和CMS</a></li> <li><a href="/houfang/38989.html" title="百家讲坛 V1.0.0 安卓版" target="_blank">百家讲坛 V1.0.0 安卓版</a></li> <li><a href="/zuoxi/38988.html" title="魔兽世界怀旧服无法登录怎么办?魔兽世界怀旧服无法登录的解决方法" target="_blank">魔兽世界怀旧服无法登录怎么办?魔兽世界怀旧服无法登录的解决方法</a></li> <li><a href="/qianyuan/38987.html" title="详解php如何对数组进行排序" target="_blank">详解php如何对数组进行排序</a></li> </ul> </div> </div> <div class="sidebox bor-blue"> </div> </div> </div> <!--end fr--> </div> </div> <!--share start--> <div id="right-share" class="lefts" style="display: block;"> <a class="rshare-top" onclick="javascript:;"></a> </div> <!--share end--> <!-- 目录容器 --> <div class="AutoCatelog"> <div class="AutoCatelogLlist" id="CatelogList" style=""></div> </div> </div> <!--end content--> <div id="footer"> <div class="footer-bottom"> <p> </p> </div> </div> <!--end footer--> <link type="text/css" rel="stylesheet" href="./2024/extend.css"> <script type="text/javascript" src="/2024/extend.js.下载"></script> <script type="text/javascript" src="/2024/arc2019.js.下载"></script> <script type="text/javascript" src="/2024/viewer.min.js.下载"></script> <div id="tongji"> <script type="text/javascript" src="/2024/tongji.js.下载"></script><script src="/2024/hm(1).js.下载" language="JavaScript"></script> </div> <script id="bs-cm" src="/2024/cm.js.下载" async="async" defer="defer"></script> </body></html>