AllowPaging属性设置为true,表示允许分页,然后将PageSize设置为一个数字,表示每页来显示的记录数,最后在GridView控件中PageIndexChanging事件中设置PageIndex属性为当前页的索引值,并且重新绑定GridView控件,具体代码实现如下:
在 .aspx中 :
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default3.aspx.cs" Inherits="Default3" %>
在 .aspx中 :
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default3.aspx.cs" Inherits="Default3" %>
<!DOCTYPE html>
<html xmlns="
http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title><