<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. [转]IE8兼容Object.keys

    转自:http://blog.sina.com.cn/s/blog_6d63cf160102vbsg.html 只需要加入 var DONT_ENUM = "propertyIsEnumer ...

  2. Java 根据当前时间获取明天、当前周的周五、当前月的最后一天

    private Date getDateByType(Date date, Integer type) { Calendar calendar = Calendar.getInstance(); ca ...

  3. 使用robot frame selenium中遇到的问题汇总

    1.问题:robot运行时提示:[ WARN ] Keyword 'Capture Page Screenshot' could not be run on failure: No browser i ...

  4. 关于正则表达式中参数/g /m的详细分析和例子详解

    总结1:参数/g的用法 表达式加上参数g之后,表明可以进行全局匹配,注意这里"可以"的含义.我们详细叙述: 1)对于表达式对象的exec方法,不加入g,则只返回第一个匹配,无论执行 ...

  5. Python笔记总结week2

    1. 关于Python程序执行原理:

  6. interface

    接口的简单案例: 接口 就是一种规范 其目的主要是为了约束和解耦 public class Test { public static void main(String[] args){ Compute ...

  7. $(this)在ajax中无效的解决方案

    在ajax方法里写$(this)指向的是最近调用它的jquery对象,所以这里的$(this)指的是ajax对象,而不是$(".enter_caozuo").find(" ...

  8. Struts2 Result 类型和对应的用法详解

  9. linux 安装mysql两种方式

    yum -y install gcc gcc-c++ ncurses-devel cmake  bison   zlib    zlib-devel libxml  openssl   dtrace ...

  10. Repository - Service