最后是我的ASPX代码:
<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>无标题页</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        &nbsp;
       <center>
            <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" BackColor="Yellow"
                ForeColor="Black" Width="372px"  AllowPaging="True">
                <Columns>
                    <asp:BoundField DataField="OrderID" HeaderText="员工ID" />
                    <asp:BoundField DataField="EmployeeID" HeaderText="顾客ID" />
                    <asp:BoundField DataField="ShipVia" HeaderText="ShipID" />
                </Columns>
            </asp:GridView>
            </center>
        <br />
        <br />
        <center style="text-align: left">
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;
            <asp:LinkButton ID="LinkButton1" runat="server" CommandArgument="First">首页</asp:LinkButton>
            &nbsp;&nbsp; &nbsp;&nbsp;
            <asp:LinkButton ID="LinkButton2" runat="server" CommandArgument="Prev">上一页</asp:LinkButton>
            &nbsp; &nbsp;
            <asp:LinkButton ID="LinkButton3" runat="server" CommandArgument="Next">下一页</asp:LinkButton>
            &nbsp;&nbsp;
            <asp:LinkButton ID="LinkButton4" runat="server" CommandArgument="Last">尾页</asp:LinkButton></center>
        </div>
       
    </form>
</body>
</html>

解决方案 »

  1.   

    在控件属性面板中,事件 >PageIndexChanging在选项里双击,就有会有个事件,保存再看看
      

  2.   

    如果解决大数据量的分页读取最好不用GridView自带的分页,看看aspnetpage吧,最好配合一个高效的存储过程,每次只返回一页,这样选择任何一页速度几乎没有区别,才是能实现高效
      

  3.   

    在控件属性面板中,事件 >PageIndexChanging在选项里双击,就有会有个事件,保存再看看还是不行啊!  到底该怎么解决这个问题了???
      

  4.   

    protected void GridView1_PageIndexChanged(object source,System.Web.UI.WebControls.DataGridPageChangedEventArgs e)
    改成 protected void GridView1_PageIndexChanging(object source,System.Web.UI.WebControls.DataGridPageChangedEventArgs e)
      

  5.   

    同意楼上,换成GridView1_PageIndexChanging试试
      

  6.   

    异常详细信息: System.Web.HttpException: GridView“GridView1”激发了未处理的事件“PageIndexChanging”。
      

  7.   

    witer666(linux) 说的那个改法也没用,我试过了不行的````还是显示那个错误````