asp.neturl-rewritingpagination

How did dotnetkicks.com implement their ASP.NET paging?


I know the dotnetkicks.com system is open source so I can view the code myself but I can't make sense of how they did their paging. It's hard to explain but if you goto dotnetkicks.com you can play with the paging on their front page.

What I am specifically interested in is how they show the first few pages, then "..." and then the last few pages.

It starts off like this

Prev 1 2 3 4 5 6 ... 355 356 Next

Then if you hit page 10 it changes to this

Prev 1 2 ... 6 7 8 9 10 11 12 13 14 ... 355 356 Next

It's by far my favorite paging system so I'd like to do the same thing on my websites


Solution

  • The Pagination control in the project is fairly straight forward, if you've ever written a paging control. I think what may be confusing you is the use of urlrewriting.net for the /page/n url format.