I currently have a ListView control that is used to render a page of data. A DataPager control is attached to this, and is set to page 10 records at a time. An esDataSource control is used to source the data via the (ListView's DataSourceID), and AutoPaging is set to true.
Everything appears to work fine. However... What I'm finding (via SQL Server Profiler) is that there's an additional, unexpected, hit to the database when paging through data. For example:
Viewing rows 1 - 10.
I click on the "Next" button in the paging control.
esDataSource's esSelect event fires and retrieves rows 1 - 10 again (!?)
esDataSource then obtains a total record count.
esDataSource then retrieves rows 11 - 20.
I click on the "Next" button in the paging control.
esDataSource's esSelect event fires and retrieves rows 1 - 10 again (!?)
esDataSource then obtains a total record count.
esDataSource then retrieves rows 21 - 30.
Why is the additional database hit happening? Why are rows 1 - 10 retrieved regardless of what page of data is requested?
Thanks
Leigh