I have noticed a problem on my paging results that I made to look like google.
Here is what is meant to happen: 10 results either side of the page being viewed are meant to display, so say I am on page 30, I see 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40.
When on single digit pages it is meant to show as many as it can to the left and ten to the right so page 4 sho0uld show 1 2 3 4 5 6 7 8 9 10 11 12 13
The results page shows 14 records at a time on each page.
However I am getting a problem:
The first set of results (page 1) show the first 14 results,
clicking to page 2 shows results 28 - 42
clicking back to page 1 shows 14-28
So there are two issues, the results are missing the second set of results and skipping straight to what should be on page 3, but when I go back to page 1 they miss the first 14 and start at 14.
I have starred at this so much that I can`t see the issue, can someone see an obvious problem?
Thanks for any help
Here is what is meant to happen: 10 results either side of the page being viewed are meant to display, so say I am on page 30, I see 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40.
When on single digit pages it is meant to show as many as it can to the left and ten to the right so page 4 sho0uld show 1 2 3 4 5 6 7 8 9 10 11 12 13
The results page shows 14 records at a time on each page.
However I am getting a problem:
The first set of results (page 1) show the first 14 results,
clicking to page 2 shows results 28 - 42
clicking back to page 1 shows 14-28
So there are two issues, the results are missing the second set of results and skipping straight to what should be on page 3, but when I go back to page 1 they miss the first 14 and start at 14.
I have starred at this so much that I can`t see the issue, can someone see an obvious problem?
Code:
<div class='prevnextbuttons'>
<%
if Request.QueryString("page") = "" then
intCurrentPage = 1
else
intCurrentPage = CInt(Request.QueryString("page"))
end if
intPageCount = allrecords/14 - 1
intPageSplit = 10
'next and previous buttons
if Request.QueryString("page") = "" then intnextpage = 2 else intnextpage = Request.QueryString("page") + 1
intprevpage = Request.QueryString("page") - 1
'previous button
if intprevpage >= 1 then
response.write "<a href='?page=" & intprevpage & "&genre="&strgenre&"&profiletype="&strprofiletype&"&location="&strLocation&"'><< Previous</a> "
end if
' -- Calculate Beginning Page Numbers --
intBegEnd = intCurrentPage - 1
If intCurrentPage > intPageSplit Then
intBegStart = intCurrentPage - intPageSplit
ElseIf intPageCount < intPageSplit OR intCurrentPage <= intPageSplit Then
intBegStart = 1
End If
' -- Calculate Ending Page Numbers --
intEndStart = intCurrentPage + 1
If intCurrentPage <= (intPageCount - intPageSplit) Then
intEndEnd = intCurrentPage + intPageSplit
ElseIf intCurrentPage > (intPageCount - intPageSplit) Then
intEndEnd = intPageCount
End If
' -- Create Page Numbers --
For x = intBegStart To intBegEnd
response.write "<a href='?page=" & x & "&genre="&strgenre&"&profiletype="&strprofiletype&"&location="&strLocation&"'>" & x & "</a> | "
Next
response.write "<b> Page " & intCurrentPage & "</b>"
For x = intEndStart To intEndEnd
response.write " | <a href='?page=" & x & "&genre="&strgenre&"&profiletype="&strprofiletype&"&location="&strLocation&"'>" & x & "</a>"
Next
%>
<%
'next button
if intnextpage <= intEndEnd then
response.write " <a href='?page=" & intnextpage & "&genre="&strgenre&"&profiletype="&strprofiletype&"&location="&strLocation&"'>Next >></a>"
end if
%>
</div>
Thanks for any help