views:

39

answers:

1

I am using a ListView for displaying list of items in a List page. I am also using DataPager control in my page for paging.

PROBLEM While I am in the middle of the List let 5th page out of 10 pages and going to another page then clicking browser back button I am again comming back to my list page with page number showing 1st page out of 10.

What could be the solution.

Thanks in advance.

+1  A: 

ASP.NET uses PostBacks to manipulate the state of the form, such as paging. What this means is that every interaction on the page - a button click, a LinkButton click - is really just submitting (posting) a form back to the same page. Hence the name, postback. An unfortunate downside of this approach is that it breaks the back button.

One possible fix is to use the Post/Redirect pattern which is becoming more common with ASP.NET MVC, but the principles still apply. However, I'd strongly discourage using widely in your application, as it would essentially double the amount of requests.

Rex M