i m new to asp.net and i m using paging concept in gridview
and i have use this code given below at my .aspx page
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" ShowFooter="True"
onrowcancelingedit="GridView1_RowCancelingEdit"
onrowdeleting="GridView1_RowDeleting" onrowediting="GridView1_RowEditing"
onrowupdating="GridView1_RowUpdating" AllowPaging="True" AllowSorting="True" PageSize="3"
onselectedindexchanged="GridView1_SelectedIndexChanged1"
OnPageIndexChanging="GridView1_PageIndexChanging">
-------------------------------------------------------------------
i need this code given below at my cs page but it is not appearing on cs page still i have used OnPageIndexChanging="GridView1_PageIndexChanging" event at aspx page can anybody tell me how can i use it at my cs page
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
gridView.PageIndex = e.NewPageIndex;
gridView.DataBind();
}
---------------------------
when i run the this type of error comes
When changing the page on the GridView control:
The GridView 'GridViewID' fired event PageIndexChanging which wasn't handled.
CS1061: 'ASP.default_aspx' does not contain a definition for 'GridView1_PageIndexChanging' and no extension method 'GridView1_PageIndexChanging' accepting a first argument of type 'ASP.default_aspx' could be found (are you missing a using directive or an assembly reference?)
So pls suggest me.
thanks and regards
Ansar