Hope this is what you referred:
http://www.asp.happycoding
Main Topics
Browse All TopicsHello,
I have a database with about 500 or so records in it. I'm setting my pagesize to 10 so that my asp page will display only 10 records per page.
My current page navigation looks like:
<< Prev 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,14,15,16,17....etc.....
This results in having roughly 50 links for page navigation on this particular page. Looks cramped!
What I would like to have for navigation would be something like this:
Lets say I was on page 1...
1,2,3,4,5,6,7,8,9,10 Next > Last >>
Lets say I was on page 10...
<< First < Prev 5,6,7,8,9,10,11,12,13,14 Next > Last >>
I would like to have only 10 paging links to show at a time along with the << First < Prev Next > Last >> functionality.
I've fooled with lots of examples over the course of the day and im about to give up. Please help.
Thanks in advance.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Hope this is what you referred:
http://www.asp.happycoding
Hi DarthSonic,
So I implemented your code and there are still some issues...It needs some more logic built in.
For example. The current recordset im dealing with has 19 pages.
This is what it looks like if on page 1:
-4,-3,-2,-1,0,1,2,3,4,5,6 Next > Last >>
This is what my pagination looks like if on page 10:
<< First < Prev 5,6,7,8,9,10,11,12,13,14,1
This is what my pagination looks like if on page 17 (only 19 pages in RS):
<< First < Prev 12,13,14,15,16,17,18,19,20
There should be boundries at the beginning and end of the recordset so that it does not create bogus links.
No matter what page in the recordset im on...there should always be 10 page links shown.
For example if the recordset has 19 pages.
If I was on page 1 it shoudld look like this:
1,2,3,4,5,6,7,8,9,10 Next > Last >>
If I was on page 10 it shoudld look like this:
<< First < Prev 5,6,7,8,9,10,11,12,13,14 Next > Last >>
If I was on page 17 it should look like this:
<< First < Prev 10,11,12,13,14,15,16,17,18
Thanks
I solved this one on my own. Had to throw in some math to get what i wanted.
If Page < 10 Then
StartPage = 1
EndPage = 10
Else
StartPage = Page - 5
EndPage = Page + 4
If EndPage > RSPageCount Then
EndPage = RSPageCount
StartPage = EndPage - 9
End If
End if
For PageCounter = StartPage To EndPage
If PageCounter <> Page Then
Response.Write "<a href='http://localhost/"& sURL &"/"& PageCounter &"'>"& PageCounter &"</a>"
Else
'The active page
Response.Write(PageCounter
End If
'Writes | as a separator if we're not at the last link
If PageCounter <> RSPageCount Then Response.Write(" | ")
Next
>>You should have granted some points to the ones helping you.<<
I agree. From the EE Guidelines:
<quote>
How do I close a question?
There are five ways:
Accept an Expert's comment as the solution
If an Expert has given you the solution to your question, or has led you to the solution, select this option.
Accept multiple solutions
If several Experts collaborated to provide a solution, use this option and split the points among them.
Accept your own comment as the solution
If you solved your problem with no assistance from any Expert, post your solution and then click the Accept As Solution button in your own comment.
Accept your own comment, and award points to Experts for their assistance
If you answered your own question, but wish to award points to Experts for their attempts to help, use this option.
Delete your question
If you are not getting the kinds of responses that will lead to a solution, you should consider deleting your question and trying again. The Delete Question button is located near the text of your original post.
If you are not certain which selection to make, click the Request Attention button, and the Moderators will help you with the proper choice.
</quote>
But never mind the EE Guidelines, they obviously do nothing for you, so let me appeal to a more basic motivation: Just remember that the next time you need help, the person helping you here may think twice before responding.
Your choice.
Business Accounts
Answer for Membership
by: maddhacker24Posted on 2009-08-24 at 18:13:30ID: 25173917
upped the points...