I'm trying to prevent the back button from working on one of my asp.net mvc pages. I've read a couple of places that if i add "window.history.forward();" it will prevent the back button from working on a given page. This is what I did in my page:
<script type="text/javascript">
$(document).ready(function ()
{
window.history.forward();
});
</script>
I can't seem to get this to work. has anyone had any luck with this method? perhaps I'm taking the wrong approach. any help would be appreciated. thanks.