| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 3295 人关注过本帖
标题:CS0117: “System.EventArgs”并不包含“NewPageIndex”的定义
只看楼主 加入收藏
水晶心
Rank: 1
等 级:新手上路
帖 子:69
专家分:0
注 册:2010-7-27
结帖率:80%
收藏
已结贴  问题点数:20 回复次数:3 
CS0117: “System.EventArgs”并不包含“NewPageIndex”的定义
public partial class kqmanage : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
            BindGrid();

    }
    private void BindGrid()
    {
        string str = ConfigurationSettings.AppSettings["dsn"];
        SqlConnection cn = new SqlConnection(str);
        cn.Open();
        String mysql = "select * from kq";
        SqlDataAdapter da = new SqlDataAdapter(mysql, cn);
        DataSet ds = new DataSet();
        da.Fill(ds);
        GridView1.DataBind();
        cn.Close();

    }
    protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
    {
        this.GridView1.PageIndex = e.NewPageIndex;
        BindGrid();//重新绑定记录
    }
   
    protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        //GridView gv = (GridView)sender;
        //string aa = e.RowIndex.ToString();
        //string id = gv.DataKeys[e.RowIndex].ToString();
    }

    protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
    {
        this.GridView1.EditIndex = e.NewEditIndex;
        BindGrid();
    }
    protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {

    }
    //当取消时触发
    protected void GridView1_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
    {
        this.GridView1.EditIndex = -1;
        BindGrid();
    }
    protected void LinkButton8_Click(object sender, EventArgs e)
    {
        Response.Redirect("kamanageadd.aspx");

    }
   
    protected void Button1_Click(object sender, EventArgs e)
    {
        try
        {
            int vardid = Convert.ToInt32(txt_kid.Text.ToString());
            Response.Redirect("kpmodify.aspx?kid=" + vardid);
        }
        catch
        {
            Response.Write("输入的编号不正确");
            Response.End();
        }

    }
}
搜索更多相关主题的帖子: NewPageIndex EventArgs System 定义 
2010-08-16 16:50
水晶心
Rank: 1
等 级:新手上路
帖 子:69
专家分:0
注 册:2010-7-27
收藏
得分:0 
<asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True"
            AutoGenerateColumns="False" BackColor="White" BorderColor="#CC9966" BorderStyle="None"
            BorderWidth="1px" CellPadding="4" DataKeyNames="kid" DataSourceID="SqlDataSource1"
            OnSelectedIndexChanged="GridView1_SelectedIndexChanged" PageSize="5" Style="z-index: 109;
            left: 140px; position: absolute; top: 148px" Width="396px" HorizontalAlign="Left">
            <FooterStyle BackColor="#FFFFCC" ForeColor="#330099" />
            <Columns>
                <asp:BoundField DataField="kid" HeaderText="kid" ReadOnly="True" SortExpression="kid" />
                <asp:BoundField DataField="uid" HeaderText="uid" SortExpression="uid" />
                <asp:BoundField DataField="uname" HeaderText="uname" SortExpression="uname" />
                <asp:BoundField DataField="kqdate" HeaderText="kqdate" SortExpression="kqdate" />
                <asp:BoundField DataField="dgdate" HeaderText="dgdate" SortExpression="dgdate" />
                <asp:BoundField DataField="cq" HeaderText="cq" SortExpression="cq" />
                <asp:BoundField DataField="sj" HeaderText="sj" SortExpression="sj" />
                <asp:BoundField DataField="bj" HeaderText="bj" SortExpression="bj" />
                <asp:BoundField DataField="gj" HeaderText="gj" SortExpression="gj" />
                <asp:BoundField DataField="kg" HeaderText="kg" SortExpression="kg" />
                <asp:BoundField DataField="hj" HeaderText="hj" SortExpression="hj" />
                <asp:BoundField DataField="sj1" HeaderText="sj1" SortExpression="sj1" />
                <asp:BoundField DataField="gxj" HeaderText="gxj" SortExpression="gxj" />
                <asp:BoundField DataField="tqj" HeaderText="tqj" SortExpression="tqj" />
                <asp:BoundField DataField="pc" HeaderText="pc" SortExpression="pc" />
                <asp:BoundField DataField="cc" HeaderText="cc" SortExpression="cc" />
                <asp:BoundField DataField="dx" HeaderText="dx" SortExpression="dx" />
                <asp:CommandField ShowEditButton="True" />
                <asp:CommandField ShowDeleteButton="True" />
            </Columns>
            <RowStyle BackColor="White" ForeColor="#330099" />
            <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="#663399" />
            <PagerStyle BackColor="#FFFFCC" ForeColor="#330099" HorizontalAlign="Center" />
            <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="#FFFFCC" />
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:kqConnectionString %>"
            SelectCommand="SELECT [kid], [uid], [uname], [kqdate], [dgdate], [cq], [sj], [bj], [gj], [kg], [hj], [sj1], [gxj], [tqj], [pc], [cc], [dx] FROM [kaoqin]">
        </asp:SqlDataSource>
        &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
        &nbsp;&nbsp;
        <asp:Table ID="Table3" runat="server" Height="368px" Style="z-index: 110; left: 26px;
            position: absolute; top: 125px" Width="112px" HorizontalAlign="Left" GridLines="Horizontal">
            <asp:TableRow runat="server">
                <asp:TableCell runat="server" Height="20px" HorizontalAlign="Center" VerticalAlign="Middle">
                <asp:LinkButton ID="LinkButton1" runat="server" PostBackUrl="adminmassage.aspx">人员管理信息</asp:LinkButton>
           </asp:TableCell>
            </asp:TableRow>
            <asp:TableRow runat="server">
            </asp:TableRow>
            <asp:TableRow runat="server">
                <asp:TableCell runat="server"><asp:LinkButton ID="LinkButton2" runat="server" PostBackUrl="demanage.aspx">部门信息管理</asp:LinkButton></asp:TableCell>
            </asp:TableRow>
            <asp:TableRow runat="server">
            </asp:TableRow>
            <asp:TableRow runat="server">
                <asp:TableCell runat="server"><asp:LinkButton ID="LinkButton3" runat="server" PostBackUrl="kqmanage.aspx">考勤信息管理</asp:LinkButton></asp:TableCell>
            </asp:TableRow>
            <asp:TableRow runat="server">
            </asp:TableRow>
            <asp:TableRow ID="TableRow1" runat="server">
                <asp:TableCell ID="TableCell1" runat="server"><asp:LinkButton ID="LinkButton7" runat="server" PostBackUrl="jbmanage.aspx">加班信息管理</asp:LinkButton></asp:TableCell>
            </asp:TableRow>
            <asp:TableRow ID="TableRow2" runat="server">
                <asp:TableCell ID="TableCell2" runat="server"><asp:LinkButton ID="LinkButton9" runat="server" PostBackUrl="zbmanage.aspx">值班信息管理</asp:LinkButton></asp:TableCell>
            </asp:TableRow>
            <asp:TableRow runat="server">
                <asp:TableCell runat="server"><asp:LinkButton ID="LinkButton4" runat="server" PostBackUrl="usermanage.aspx">用户信息管理</asp:LinkButton></asp:TableCell>
            </asp:TableRow>
            <asp:TableRow runat="server">
            </asp:TableRow>
            <asp:TableRow runat="server">
                <asp:TableCell runat="server"><asp:LinkButton ID="LinkButton5" runat="server" PostBackUrl="usermodify.aspx" >个人密码修改</asp:LinkButton></asp:TableCell>
            </asp:TableRow>
            <asp:TableRow runat="server">
            </asp:TableRow>
            <asp:TableRow runat="server">
                <asp:TableCell runat="server" HorizontalAlign="Center" VerticalAlign="Middle"><asp:LinkButton ID="LinkButton6" runat="server" PostBackUrl="Default2.aspx">注销</asp:LinkButton></asp:TableCell>
            </asp:TableRow>
            
        </asp:Table>
2010-08-16 16:51
foktime
Rank: 11Rank: 11Rank: 11Rank: 11
来 自:奥斯维辛
等 级:贵宾
威 望:35
帖 子:795
专家分:2742
注 册:2009-9-4
收藏
得分:20 
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
    {
        this.GridView1.PageIndex = e.NewPageIndex;
        BindGrid();//重新绑定记录
    }

程序代码:
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        this.GridView1.PageIndex = e.NewPageIndex;
        BindGrid();//重新绑定记录
    }


<asp:GridView AllowPaging="True" PageSize="5" onpageindexchanging="GridView1_PageIndexChanging".............>



[ 本帖最后由 foktime 于 2010-8-16 17:06 编辑 ]
2010-08-16 17:04
水晶心
Rank: 1
等 级:新手上路
帖 子:69
专家分:0
注 册:2010-7-27
收藏
得分:0 
谢谢了,可以了
2010-08-17 09:28
快速回复:CS0117: “System.EventArgs”并不包含“NewPageIndex”的定义
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.027402 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved