Disable back button using JS

Create 2 page.

In asp1.aspx :
 <asp:Button ID="Button1" runat="server" Text="Button" PostBackUrl="~/ asp2.aspx " />

In asp2.aspx:
In the body section
hi

<script language="javascript" type="text/javascript">
function DisableBackButton() {
window.history.forward();
}
setTimeout("DisableBackButton()", 0);

</script>





Comments