This is a common problem in ASP MVC. I have a simple search form with four fields and a search button. The search button uses jquery to populate a html table with the results.
The problem is that we are also trying to maintain state, as in the user goes to a different page then hits back, we want to fill the search fields with the search text and repopulate the results.
Since the populating call was Ajax, the URL was not rewritten with the proper state.
Is there a ASP MVC preferred approach to this? Or are we stuck doing post backs?
You can always update your URL according the AJAX search you’re doing.
Then in the ready event of jQuery do the search with the parameters stored in the URL if there are ; )
So once the user moves along or reload a bookmarked search, taraaaaa!… the search remains : D
UPDATE: My team says that use a hash mark in your URL will be a cleanest approach : P
here >> detecting-back-button-hash-change-in-url << you will find info at respect and some techniques ; )