I need to display a recordset in a paged manner but sometimes there are so many pages that it becomes cumbersome to display all the page links.
I wrote some crude code to display my page links like this:
1 2 3 4 5 [6] 7 8 9 10
Once you get past 6 it goes like this:
2 3 4 5 6 [7] 8 9 10 11
3 4 5 6 7 [8] 9 10 11 12 and so on.
My code uses a bunch of ugly If statements to achieve the result, but I want to know if there is a more elegant solution available.
There must be some standard algorithm that people use to achieve this result as I see it implemented on a lot of web sites on the Internet. I want to know what it is.
I wrote some crude code to display my page links like this:
1 2 3 4 5 [6] 7 8 9 10
Once you get past 6 it goes like this:
2 3 4 5 6 [7] 8 9 10 11
3 4 5 6 7 [8] 9 10 11 12 and so on.
My code uses a bunch of ugly If statements to achieve the result, but I want to know if there is a more elegant solution available.
There must be some standard algorithm that people use to achieve this result as I see it implemented on a lot of web sites on the Internet. I want to know what it is.