<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模板可分为:内容模板、编辑行模板、交替行模板、头模板、尾模板

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

asp.net中的GridView控件的部分知识点的更多相关文章

  1. (转)客户端触发Asp.net中服务端控件事件

    第一章. Asp.net中服务端控件事件是如何触发的 Asp.net 中在客户端触发服务端事件分为两种情况: 一. WebControls中的Button 和HtmlControls中的Type为su ...

  2. asp.net中的ListBox控件添加双击事件

    问题:在Aspx页里的ListBox A中添加双击事件,将选中项添加到另一个ListBox B中,双击ListBox B中的选中项,删除当前选中项 页面: <asp:ListBox ID=&qu ...

  3. ASP.NET中 WebForm 窗体控件使用及总结【转】

    原文链接:http://www.cnblogs.com/ylbtech/archive/2013/03/06/2944675.html ASP.NET中 WebForm 窗体控件使用及总结. 1.A, ...

  4. .NET中使用GridView控件输入数据时出现“ Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index"的问题

    在.NET中使用GridView控件的在线编辑数据时,出现了“ Index was out of range. Must be non-negative and less than the size ...

  5. ASP.NET中使用DataGrid控件按照条件显示GridView单元格的颜色

    问题描述: 我在做一个关于信用卡管理系统时遇到一个问题:信用卡内金额低于100元时,数字颜色显示为红色,其余显示为绿色 之前,尝试了修改成为模板列以及转换成Reapeater控件,甚至用了Jquery ...

  6. ASP.NET中的chart控件绑定SQL Server数据库

    网上很多的chart控件的实例都没有绑定数据库,经过一番摸索后,终于实现了chart控件绑定数据库. 首先,在Visual Studio中建立一个网站,新建一个WebForm项目,名称为ChartTe ...

  7. ASP.NET中的验证控件

    ASP.NET提供了如下的控件: RequiredFieldValidator: 字段必填 (ControlTovalidate设定要验证的控件) RangeValidator: 值在给定的最大值,最 ...

  8. asp.net中自定义验证控件

    在windows2003中,可能iis版本太底,不支持TextBox的类型设为Number类型,所以会报错,所以去掉后直接用验证控件来控制必须输入数字好了. <asp:RegularExpres ...

  9. asp.net中的CheckBox控件的使用

    CheckBox控件中的最重要属性就是checked属性了 下面就是使用checked属性的一个小应用; 先建立一个wed窗体:在窗体中写下这些代码: <%@ Page Language=&qu ...

随机推荐

  1. 区分IE版本的三个方法

    我们通常使用IE条件判断语言来处理IE的CSS问题,但其实还是有其他的一些方法来处理IE的CSS bug的. 一.IE条件判断语句 IE条件判断语句也许是用的最多的区分IE版本(IE6, IE7, I ...

  2. 实现断点续传的FTP下载类(支持多线程多任务下载)

    using System; using System.Collections.Generic; using System.Text; using System.Threading; using Sys ...

  3. html中offsetTop、clientTop、scrollTop、offsetTop各属性介绍

    例如:$('window').scrollTop()获取的就是当前这个页面超出窗口最上端的高度,scrollLeft与此同理 scrollHeight: 获取对象的滚动高度. scrollLeft:该 ...

  4. WC项目

    #include <stdio.h> #include <string.h> int *getCharNum(char *filename, int *totalNum); i ...

  5. Bootstrap 表单

    表单布局 Bootstrap 提供了下列类型的表单布局: 垂直表单(默认) 内联表单 水平表单 垂直或基本表单 基本的表单结构是 Bootstrap 自带的,个别的表单控件自动接收一些全局样式.下面列 ...

  6. LTE Air interface Channels-----http://www.rfwireless-world.com/Tutorials/LTE-logical-transport-physical-channels.html

    LTE technology works based on three channel types viz. logical channel,transport channel and physica ...

  7. mysql 批量插入数据存储过程

    create procedure pFastCreateNums (cnt int unsigned) begin declare s int unsigned default 1; truncate ...

  8. Mac OS X下重启apache

    打开终端 重启apache:sudo /usr/sbin/apachectl restart 关闭apache:sudo /usr/sbin/apachectl stop 开启apache:sudo ...

  9. jenkins安装配置-白痴教程

    1. Maven安装 下载maven安装包,放置在usr/maven目录下:apache-maven-3.2.5-bin.tar.gz tar zxvf apache-maven-3.2.5-bin. ...

  10. Excel学习技巧

    ctrl+R 初始化信息 ctrl+T 创建表列 ctrl+o 保存文件