I have an asp.net form used for search. The search result is showing on the same page using Ajax. If I navigate to another page and come back, I get the populated form but the search result is empty. What's the best way to go back to the page and have the result populated.
Or how to force the page to post back to repopulate the page with the results when back button is clicked?
You can do this using the EnableHistory property on the ScriptManager. Once you've set the ScriptManager's EnableHistory property to True, you can use the AddHistoryPoint method to set history points in your page.
<asp:ScriptManager runat="server" ID="MyScriptManager" EnableHistory="True">
</asp:ScriptManager>
Dino Esposito has a good pair of articles here (client-side) and here (server-side) about using the scriptmanager history functionality.
There are a number of frameworks that attempmt to handle the back button and ajax.
Here is Microsoft 's
Here is one called really simple history
Here are a few more if you are using jQuery:
http://plugins.jquery.com/project/history
http://stilbuero.de/jquery/history/
http://www.overset.com/2008/06/18/jquery-history-plugin/
https://stackoverflow.com/questions/116446/what-is-the-best-back-button-jquery-plugin
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With