I need to back to a data input page without clearing the original values.
I new I could do this with standard html like this:
<input type="button" value=" Cancel " onClick="javascript:history.go(-1)">
so in asp.net I reasoned this would work
<asp:button id="BackButton" runat="server" width="190px" height="60px" text=" Return To Input Page " CausesValidation="false" />
with
BackButton.Attributes.Add("onclick","history.go(-1);");
In the
PageLoad event would do the trick. However it just refreshed the current page. After trying many variations I found the linked page that provided the answer. The trick is to add
return false; to the onlick attribute.
BackButton.Attributes.Add("onclick","history.back(); return false;");