Let’s say there are two forms, default1.aspx and default2.aspx, and we need to prevent the user to navigate back to the default1.aspx once the user is in the default2.aspx.
This code, tested in IE, Chrome and Firefox
Prevents Back button default1.aspx
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<script type = "text/javascript" >
window.history.forward();
function preventBack() { window.history.forward(1); }
//setTimeout("preventBack()", 0);
//window.onunload = function () { null };
</script>
<title>
</title>
</head>
<body onload="preventBack();" onpageshow="if (event.persisted) preventBack();" onunload="">
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html>

Sagar JadhavPosted Aug 2, 2018, 1:50 PM
It's Working...Fine Thanks..
Priya PalanisamyPosted May 16, 2017, 9:52 AM
Wat if user clicks on browser back button during the page load event. In chrome the page keeps on loading doesnt knows whether to go back or forward.