I'm doing recordset paging, and I'm having a problem with the navigation.
Let's say that originally, the page url is test.asp. When the page loads for the first time that is the url. However once you begin navigating from one page to the next via the recordset navigation, the url becomes test.asp?Page=1, or test.asp?Page=3, etc...
Everything is working properly except for the "Next Page" navigation. It only works when the url is in its original state of test.asp. Once you begin navigating, the "Next Page" link stays silver and unlinked, which it should actually only do when it's on the very last page of course.
The code follows, I'd appreciate any assistance:
Let's say that originally, the page url is test.asp. When the page loads for the first time that is the url. However once you begin navigating from one page to the next via the recordset navigation, the url becomes test.asp?Page=1, or test.asp?Page=3, etc...
Everything is working properly except for the "Next Page" navigation. It only works when the url is in its original state of test.asp. Once you begin navigating, the "Next Page" link stays silver and unlinked, which it should actually only do when it's on the very last page of course.
The code follows, I'd appreciate any assistance:
Code:
Response.Write "<div align=""center"">" & vbcrlf
Response.Write "<a href="""
Response.Write Request.ServerVariables("SCRIPT_NAME")
Response.Write "?Page=1""><b>First Page</b></a>"
Response.Write " | "
If Page = 1 Then
Response.Write "<span style=""color:silver;"">Previous Page</span>"
Else
Response.Write "<a href=""" & Request.ServerVariables("SCRIPT_NAME")
Response.Write "?Page=" & Page - 1 & """><b>Previous Page</b></a>"
End If
Response.Write " | "
For PageCounter = 1 to qProd.PageCount
Response.Write "<a href='test.asp?Page=" & PageCounter & "'>" & PageCounter & "</a> "
Next
Response.Write " | "
If Page >= pagecnt Then
Response.Write "<span style=""color:silver;"">Next Page</span>"
Else
Response.Write "<a href=""" & _
Request.ServerVariables("SCRIPT_NAME")
Response.Write "?Page=" & Page + 1 & """>Next Page</a>"
End If
Response.Write " | "
Response.Write "<a href=""" & Request.ServerVariables("SCRIPT_NAME")
Response.Write "?Page=" & pagecnt & """><b>Last Page</b></a>"
Response.Write "</div>" & vbcrlf