Home » Asp.net

window.history.forward(1) or history.go(1) doesn't work in IE 7 to prevent back button, works in IE

Hi, I know the issues has been beat to death, but hack below worked ok in IE6. However it doesn't work in IE 7, any ideas on how to replicate the same functionality in IE 7?

<body onload="window.history.forward(1);" or history.go(1)

 Thanks for any suggestions or pointers.



4 Answers Found


Answer 1


I tried and found that the javascript works on my pc, I am also using IE7. Make sure that the javascript is enabled by IE7.



Answer 2

andryuha, if u are facing this problem even after enabling javascript. Then, use debugger and check if there is any alternative. I feel debugger is the best way to crack down javascript {:)]


Answer 3


I want sisable the back button for my entire website..

Am I need to add the "window.history.forward(1)" in every page.

Is there any alternative way..

Please suggest me..

Thanks in advance..


Answer 4

I know your case.

what i did is to put  the following code on my master page:

<head id="Head1" runat="server">
 <script type="text/javascript" language="javascript">
     javascript: window.history.forward(1);

which works for ALL browsers!




<< Previous      Next >>

Microsoft   |   Windows   |   Visual Studio   |   Sharepoint   |   Azure