Click here to Skip to main content
15,890,043 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
http://www.stepcoder.com/Articles/10011/how-to-apply-pagination-in-repeater-control-using-asp-net[^]

I am using the above article to apply pagination in repeater control.. It works fine.. The only problem is that it is showing same url for each page.. it doesn't change url on click of the page number. Although it changes the products on the page..

The only thing i want is, when user click on page number then the URL will be like this :

mydomain.com/products.aspx?page=1
mydomain.com/products.aspx?page=2
mydomain.com/products.aspx?page=3 and so on........

Please suggest me changes and modifications in the article to achieve the above task.
Posted
Comments
F-ES Sitecore 18-May-15 4:30am    
This isn't a trivial change to make. That example uses LinkButtons, probably the one control no professional developer should ever use. It results in exactly the issues you are seeing, you have page state that can't be achieved via direct navigation so it is a bad solution for paging\filtering\ordering. You need to get rid of LinkButtons and use normal asp:Hyperlinks and manually construct the params you want (page=x) and rather than use the click events of the LinkButtons to know the page has changed, you read the params from the querystring in Page_Load (string page = Request.QueryString["page"]) to know which page you should be showing.

It's going to need a lot of changes though and it's going to need you to thoroughly understand the code.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900