Sometimes while using Grid View control and setting .net GridView AllowPaging property True and not handling the paging in code behind it throws exception "System.Web.HttpException: The GridView fired event PageIndexChanging which wasn’t handled" as shown in picture below:
This exception can be handled on PageIndexChangingevent of Grid View Control.
The code to solve this problem is given below:
protectedvoid grdstudent_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
grdstudent.PageIndex = e.NewPageIndex;
Bind_Grid();
}
Here grdstudent is the ID of the Grid View control. Change this one with your Grid View Id and Bind_Grid() method is used to Bind the grid view control with database. Replace this one with your method of binding the grid view control.
Hope this one sort out your problem.