<PagerTemplate>

            <br />
<asp:Label ID="lblPage" runat="server" Text='<%# "第" + (((GridView)Container.NamingContainer).PageIndex + 1) + "页/共" + (((GridView)Container.NamingContainer).PageCount) + "页" %> '></asp:Label>
<asp:LinkButton ID="lbnFirst" runat="Server" Text="首页" Enabled='<%# ((GridView)Container.NamingContainer).PageIndex != 0 %>' CommandName="Page" CommandArgument="First" ></asp:LinkButton>
<asp:LinkButton ID="lbnPrev" runat="server" Text="上一页" Enabled='<%# ((GridView)Container.NamingContainer).PageIndex != 0 %>' CommandName="Page" CommandArgument="Prev" ></asp:LinkButton>
<asp:LinkButton ID="lbnNext" runat="Server" Text="下一页" Enabled='<%# ((GridView)Container.NamingContainer).PageIndex != (((GridView)Container.NamingContainer).PageCount - 1) %>' CommandName="Page" CommandArgument="Next" ></asp:LinkButton>
<asp:LinkButton ID="lbnLast" runat="Server" Text="尾页" Enabled='<%# ((GridView)Container.NamingContainer).PageIndex != (((GridView)Container.NamingContainer).PageCount - 1) %>' CommandName="Page" CommandArgument="Last" ></asp:LinkButton>
到第 <asp:TextBox ID="txtPageNumber" runat="server"></asp:TextBox>
<asp:Button ID="btnPage" Text="Go" runat="server" CommandName="MyPage" />
</PagerTemplate>

GridView---数据绑定控件之数据表格

什么是数据源

  通过数据源控件可以直接绑定数据 2.可以设置“自动套用格式”来改变样式(外观) 3.可以通过数据源控制实现在线编辑、删除、选中 4.通过自动生成列,可以使GridView从数据源中自动提取列信息 5.GridView可以包含多种列类型:BoundField(绑定列)、CheckBoxField(复选框列)、HyperLinkField(超链接列)、、ImageField(图片列)、ButtonField(按钮列)、CommonField(命令列)、TemplateField(模板列) 6.GridView内置了很多命令:edit、delete、update、cancel、select、自定义命令

  其中,TemplateField模板可分为:内容模板、编辑行模板、交替行模板、头模板、尾模板

  今天,给大家共享一个关于网站开发中分页的代码,希望可以用上哦,小伙伴们

最新文章

  1. 导出csv文件示例
  2. USR-BLE101配置
  3. linux查找日志技巧
  4. 解决IDEA自动重置LanguageLevel和JavaCompiler版本的问题
  5. selenium使用actions.moveToElement处理菜单
  6. Python 之 【re模块的正则表达式学习】
  7. HDUOJ----1234 开门人和关门人(浙江大学考研题)
  8. expect批量分发公钥
  9. thinkphp的条件的多种写法
  10. 超赞的.NET办公软件库
  11. 常见的html面试题
  12. Springboot-shiro-redis实现登录认证和权限管理
  13. 虚拟机上的centos7链接不上网络: activation of network connection failed
  14. vim命令编辑Host文件
  15. CSRF篇-本着就了解安全本质的想法,尽可能的用通俗易懂的语言去解释安全漏洞问题
  16. myeclipse连接mysql失败出错,已解决问题
  17. 高版本sonar安装遇到的坑-sonar 6.6
  18. Android学习笔记PreferenceFragment的使用
  19. sys.usb.config webcam
  20. L232 No methane on Mars

热门文章

  1. JS基本概念
  2. G:数字三角形
  3. .Net Globalization and Localization
  4. 《Linux内核设计与实现》课本第三章自学笔记——20135203齐岳
  5. [转]EntityFramework状态变化AutoDetectChangesEnabled与SaveChanged参数说明
  6. myhandle
  7. tomcat重启脚本
  8. 大话设计模式之&lt;一&gt;计算器的深思
  9. MySQL数据库的一些基本操作及注释
  10. H5之contenteditable