| Gridview PageIndexChanging |
|
You have enabled the gridview property allowpaging to true and when you run the page you get an error similar to the below: The reason you are getting this error is because you need to set the OnPageIndexChanging event. This event is raised whenever you click on the page number. In the event method you can peforms your custom routine code such as canceling the paging operation. On the ASPX file make sure you have enable the OnPageIndexChanging event. In the asp OnPageIndexChanging="gvResult_PageIndexChanging" AllowPaging="true" PageSize="2">
On the class make sure you have the following method. protected void gvResult_PageIndexChanging(object sender, GridViewPageEventArgs e) { gridView.PageIndex = e.NewPageIndex; gridView.DataBind(); }
|