Click here to Skip to main content
15,921,660 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am having a page in asp.net now i want once user entered this page . he should not move back i.e previous page anyway, disable back button of browser and such all possiblities for moving back.
Posted

see this


ASP.NET
<head runat="server">

<title>Untitled Page</title>

<script type = "text/javascript" >

function preventBack(){window.history.forward();}

setTimeout("preventBack()", 0);

window.onunload=function(){null};

</script>

</head>

<body>

<form id="form1" runat="server">

<div>

<h1>Hi this is a test page</h1>

<a href ="index.html">Diable Back Button</a>

</div>

</form>

</body>

</html>



Disable Browser back Button[^]
 
Share this answer
 
v2
if you search code project you get answer....

Disabling browser's back button[^]

regards...:)
 
Share this answer
 
 
Share this answer
 
Hello ,
you can write below js in header <head> section of Current Asp.Net Page
XML
<script type="text/javascript">
window.history.forward();
function noBack() { window.history.forward(); }
</script>

Then call that noback function.
XML
<body  önload="noBack();">
............
.............
</body>
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900