<p>I have a page with a few fields and a runtime-generated image on it. The contents of this page are inside an UpdatePanel. There is a button to take the user to a secondary page, which has a button that calls javascript:history.go(-1) when clicked.</p>

<p>The problem is, the first page does a full request instead of a postback or just using the state it was in before navigating away from it. That is, the fields are all reset to their default values, thereby confusing the user. I'd like their values to be retained regardless of navigation. I do not want to create a new history state for every field change.</p>

<p>Any ideas?</p>

Haven't tested this and don't know how it would work, but you could use JQuery here to select all the elements into a JQuery object
```
```
//$("input select textarea").each(function() {
$(":input").each(function() { //even better
    // do stuff here
});
```
```
this would at least cleanup the code, although you would still have to add conditional statements based on field type like you mentioned.