I'm using window.onback = history.forward(); to prevent users from resubmitting data. I know it's a hack and I don't like it either, but that's not what this question is about. The problem is that the code prevents other pages from going back to the page with the code. Let me clarify.
PageA.aspx has the JavaScript code in it. The user submits PageA, hits Back, and nothing happens. That's good. Now the user clicks a link to PageB.aspx, which does not have the code. When the user clicks the Back button, which should take her to PageA.aspx, it does not. It exhibits the same behavior as if PageB had the no-back JavaScript code.
Here's how I have it implemented in PageA.aspx:
<script type="text/javascript">
window.onback = history.forward();
</script>
I have confirmed that this code is only in PageA.aspx and not in the master, includes, or anything else. This is an ASP.NET 2.0 application running in SharePoint 2007. The browser is IE7.
Any ideas?