.NETJiNi@jigneshdesai.com  
  Home |  .NET<1.0 to 3.5> Forums Blogs |  Other Technologies Skip Navigation Links  | Quiz Contest   dotnetJini Training |   Software Development 
 
Disabling the navigation to previous page
Wednesday, 08-February-2006
One of or a combination of below options can be implemented to disable the navigation to previous page

1. Catch the keypress event and disable backspace key.
onkeydown="escBackSpace();" 
function escBackSpace() // called on document.body keydown event
{
if(event.keyCode == 8)
event.keyCode = 0;
event.returnValue=false
} } 


2. Open a new window and disable toolbars, menus etc so user has no option to click on back button.


3. Set HTTP headers 
if using ASP then 
<% 
Response.ExpiresAbsolute = #1/1/1980# 
Response.AddHeader "cache-control", "no-cache" 
Response.AddHeader "pragma", "no-cache" 
%> 
else
<head>
<meta http-equiv="Expires" CONTENT="0">
<meta http-equiv="Cache-Control" CONTENT="no-cache">
<meta http-equiv="Pragma" CONTENT="no-cache">



4. Replacing location property with current page
<A HREF="NextQuestion.aspx" onclick="javascript:location.replace(this.href); event.returnValue=false; ">Go to Next Question.</A>

Do anyone has yet another cool approach? do tell us.

Microsoft SQL Server 2005 JDBC Driver
Tuesday, 14-February-2006
Internet Explorer 7
Friday, 17-February-2006
Microsoft Unveils Windows Vista Product Lineup
Tuesday, 28-February-2006








   







Chat Online
 








Add URL | About ME Privacy Policy | Legal Disclaimer

Copyright (C) 2004 -2008 JigneshDesai.com. All rights reserved