With the following htlm:
<html>
<body>
<form action="#">
<p><input type="text"></input></p>
</form>
</body>
</html>
On load the input has an empty value. Change it to "1" and enter (submit) The page will show a "1" Pressing back will prefill the page with the entered "1" instead of the initial state (empty)
My real world application is an asp.net page where the top of the page contains search inputs and the bottom the results. When pressing back the fields are prefilled with values that don't correspond with the values shown in the results shown below.
How can I make it so that the browser's back button will prefill the page with the values that correspond with the initial state of the history's corresponding page?
I would prefer to not disable asp.net cache but wouldn't mind if there is no alternative. All the google hits for disabling cache didn't work though.
UPDATE
I would think the value of the inputs should correspond to the initial state of the entry in the history list.
This doesn't seem to be the case. It corresponds to the state right before post.
- http:\localhost:8080\index.html => input = ""
- http:\localhost:8080\index.html?val=2 => input = "2"
- http:\localhost:8080\index.html => input = "2"