Error with Datagrid paging
-
I get the ffg error when paging through a datagrid. There seems to be different permutations of this error. I have included below the steps to recreate the error. I would greatly appreciate any help I can get. ****Error Message**** System.Web.HttpException: Invalid CurrentPageIndex value. It must be >= 0 and < the PageCount ****Steps to recreate error**** * I list search results in a datagrid. * User clicks the "Next" button. New set of result is displayed. * User clicks the hyperlink on the datagrid cell. User is taken to a different page. * User clicks the browser "Back" button. * User clicks the "Next" button on the datagrid. * Error occurs.
-
I get the ffg error when paging through a datagrid. There seems to be different permutations of this error. I have included below the steps to recreate the error. I would greatly appreciate any help I can get. ****Error Message**** System.Web.HttpException: Invalid CurrentPageIndex value. It must be >= 0 and < the PageCount ****Steps to recreate error**** * I list search results in a datagrid. * User clicks the "Next" button. New set of result is displayed. * User clicks the hyperlink on the datagrid cell. User is taken to a different page. * User clicks the browser "Back" button. * User clicks the "Next" button on the datagrid. * Error occurs.
Not exactly getting you.. seems that the problem occurs when you again visit the page having datagrid.. set the currentpageindex=0 where you are filling the datagrid.. update me... lokesh
-
I get the ffg error when paging through a datagrid. There seems to be different permutations of this error. I have included below the steps to recreate the error. I would greatly appreciate any help I can get. ****Error Message**** System.Web.HttpException: Invalid CurrentPageIndex value. It must be >= 0 and < the PageCount ****Steps to recreate error**** * I list search results in a datagrid. * User clicks the "Next" button. New set of result is displayed. * User clicks the hyperlink on the datagrid cell. User is taken to a different page. * User clicks the browser "Back" button. * User clicks the "Next" button on the datagrid. * Error occurs.
It's not very clear but I think the error is either occurring in the itemCommand method when the user clicks Next, or when the page tries to reload (Page_Load). Maybe you should check those 2 methods and try step by step debugging. Another thing that just occurred to me: how are you redirecting to the new page? I haven't tried this but if you're using
Response.Redirect("....",true);
maybe you would consider changing the boolean to false and try. It's just an idea, no guarantees that it will work. When the setting is true, you're redirecting and terminating the execution of the current page, so by saying false, you would not terminate the execution and maybe this will allow the user to go back and continue working. Try it and let me know what happens :) Talal "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." --Rich Cook -
Not exactly getting you.. seems that the problem occurs when you again visit the page having datagrid.. set the currentpageindex=0 where you are filling the datagrid.. update me... lokesh