Click here to Skip to main content
15,913,722 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Friends,
i have a Requirement
there are 2 Web Forms
1)Purchase Order Form,2)PO Report.
User fills all the data in PO Form and saves it on Save Button,
there is another Button named print in which PO report generates.
my requirement is once the PO repots open Up with the Data, the User should not be able to Go back at Previous Page(Purchase Order Form)PO Report generate.

Regards,
Aamir
Posted

Try this:
JavaScript
<script type="text/javascript" language="javascript">
window.history.forward(1);
document.attachEvent("onkeydown", my_onkeydown_handler);
function my_onkeydown_handler()
{
switch (event.keyCode)
{
case 116 : // F5;
event.returnValue = false;
event.keyCode = 0;
window.status = "We have disabled F5";
break;
}
}
</script>

code behind:
C#
Session.Clear();
Session.Abandon();


Also look at following links :
Three ways to disable browser back button[^]
Use Javascript to restrict user from pressing back button in browser[^]
A Thorough examination of browser back button[^]
Simple solution[^]
Disabling browser's back functionality on sign out from Asp.Net[^]

Or check from the similar QA on CodeProject Search[^].
 
Share this answer
 

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