I am using paging to display 10 search results at a time and at the foot of the page is the big list of available pages. This was fine whilst the database was small but it is growing quickly and there are now 60 pages, so having 1 2 3 4 5 6 7 8 9 10 11 12 13 14 etc etc all the way up to 60 is taking lots of room.
SO, I have been trying to do it in a similar way to google so say I am on the 30th page, instead of it listing all pages 1-60 it will show just 10 either side i.e.
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
I think I have stared at this for too long as I am messing it up
Could someone have a quick look for me please?
So the above will loop through and display all pages but I want to just show 10 either side of request.querystring("offset")
Thanks
SO, I have been trying to do it in a similar way to google so say I am on the 30th page, instead of it listing all pages 1-60 it will show just 10 either side i.e.
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
I think I have stared at this for too long as I am messing it up
Could someone have a quick look for me please?
Code:
<%
pagelist = 0
pagelistcounter = 0
do until pagelist > allrecords
pagelistcounter = pagelistcounter + 1
'highlight page currently on
if cstr(pagelist) = request.querystring("offset") then
response.write "| <a href='?offset="&pagelist&"' class='currentpage'>"&pagelistcounter&"</a> "
else
response.write "| <a href='?offset="&pagelist&"'>"&pagelistcounter&"</a> "
end if
pagelist = pagelist + recordsonpage
loop
%>
So the above will loop through and display all pages but I want to just show 10 either side of request.querystring("offset")
Thanks