I have got a "back" button that I am using in conjunction with an ASP.Net form. The problem that I have is that any time the page does a post back, it adds another reference to that page in the history. I.E. A user goes to this form, fills out the information clicks the update button. The page then posts back, updates the record, and reloads the page. Now there are two entries for this page in history. I would like for my back button to go back through the history and take me to the first page that is not the current. I have been trying to loop through the history object, but I am not having much luck.
The function that I have listed here just shows "Undefined" in the alert window instead of a url. Can someone please help me with this. It is really being a pain.