The Pagination Problem
The pagination on the client’s site was using a session cookie to store the current page number and then that number in the session cookie was supposed to be incremented by 10:1: '... somewhere in the code we assigned the "pag" cookie a value
2: Session("pag") = 1
3: '... some more code here ...
4: currentPag = Session("pag")
5: '... currentPag increments and Session("pag") gets updated
6: currentPag += 10
7: Session("pag") = currentPag
That’s Why They Use URL Params
So that’s why they use URL parameters, right? The problem was finally fixed as soon as we implemented the page parameters. Of course we had to add some more code and make some small changes to the master page to accept that params and work with them as it should, but we managed to use the old code (read “functions and events”) and everything is working now.The Lesson Learned
If you want to do pagination from scratch be aware that browsers don’t like session cookies and they treat session cookies in different ways. Better use URL parameters then cookies. The only thing cookies are good when doing pagination is to keep you full while developing using URL parameters. But, if you don’t like the way URLs look after a long number of parameters, group them, split them inside your code and use URL rewrite, resulting in a beautiful user/search engine friendly URL. Cheers,