This is a migrated thread and some comments may be shown as answers.

How do I stop the page from refreshing when the back button is pressed?

1 Answer 32 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Chris McGrath
Top achievements
Rank 1
Chris McGrath asked on 07 Jul 2010, 09:47 PM
I've got a page on which the user can do a search and a grid is populated via ajax.  When the user clicks a link in one of the search results and sees that it is not where he wants to go, he clicks back, but the search results are gone.  Is there something that can be done to force the page to bring back the cached version of the page (assuming that the cached copy is how the page looked before clicking the link)?

We tried a solution that saved the search results in a cookie, but this caused the results to show up every time we went to the search page, not just when we click back.

Ultimately I just want the search grid to be populated when they click back, but not when they go to the page fresh.

Any way this is possible?

1 Answer, 1 is accepted

Sort by
0
Tsvetina
Telerik team
answered on 09 Jul 2010, 03:09 PM
Hi Chris,

AJAX controls, as a rule, are using XMLHttpRequests which update silently parts of the page. The browser Back and Forward functionality is only available when a full postback has occurred and that is the reason for them not to remember the last page state after AJAX request.

As a work around you can try using the History control by Nikhil Kothari which should work seamlessly with our control. Have in mind that you will need to manually add history links, as this is not handled out of the box by the MS AJAX framework.


Best wishes,
Tsvetina
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
General Discussions
Asked by
Chris McGrath
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
Share this question
or