I tried your code from this site,
it works fine while ID ORDER data is ASCE but when I try sort as DESC I am not able to get first page with last ID,
is ther any way to make this thanks