mvc and the back button

I'm new to mvc so I don't know if there is a trick to this or not. When a user runs a search on a site I'm building and I take them to the results page, if I click the back button the search form is empty. Is there some way to keep the form fields populated as they were when going back (without resorting to session)? Thanks.

13.10.2009 16:51:27
Is there some sort of redirect? Are you using Ajax?
jao 13.10.2009 17:08:30

Fields should be there by default. What browser are you using?

If you're using a regular browser, then maybe your doing something weird, like, resetting the fields via JavaScript or something. Perhaps elaborating more on your current implementation would help diagnosing your problem?

A last solution would be saving the fields as a cookie and loading them via JavaScript on the forms page inside onLoad.

13.10.2009 16:59:32
I'm using google chrome. I'm not doing anything fancy at all. The person submits the form which calls the ActionResult and shows the associated view. If in the results view I click the back button my search fields are empty.
geoff 13.10.2009 17:01:23
It could be IE 6. I don't know if 7 also has that behavior too.
Esteban Küber 13.10.2009 17:02:02
I take that back... I was in IE8. Chrome seems to work fine. IE8 doens't seem to like the back button.
geoff 13.10.2009 17:02:28