Dear Friend
Here when you click your next page., server is post pack..
so dt (datatable or dataset) should be empty.,
that is the problem., so you try to keep dt value as viewstate like
when you getting data from database then you assign like.,
viewstate("dt_data")=dt;
GridView2.DataSource = dt;
GridView2.DataBind();
then now you add page index changing code like this..
protected void GridView2_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
GridView2.PageIndex = e.NewPageIndex;
GridView2.DataSource = viewstate("dt_data");
GridView2.DataBind();
}
that's all..
now you check page index is working fine.,
I hope this information is helpful to you.,
Thanks and regards
Angappan.s