Use asp.net's pageDataSource time indexing problem resolution

  • 2020-06-01 09:24:06
  • OfStack

Error condition:

A similar error of "index 20 is either negative or greater than the number of rows" occurs when the total number of pages of the current page is less than the page number of the previous query, and the total number of pages of the new condition is less than the page number of the previous query.

Reason analysis:

When the page number index of the data to be queried is greater than 1, when the query condition is re-queried, the current page number of the data to be obtained is less than the page number obtained last time, so the new query index is less than the index of the last query, which causes the problem that the index is larger than the number of rows.

Solutions:

Initialize the page index to 1 before each requery,

Related articles: