Click here to Skip to main content
15,891,033 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
please help me to do that disabling the backspace in safari browser
Posted
Comments
CodingLover 10-Oct-11 6:03am    
Want to do this on your own browser, or on client side?
Smithers-Jones 13-Oct-11 10:34am    
Why do you want to do this? Most users hate it, if you take away control from them. I for one certainly can't stand it, if some stupid website disables the back-button. If I see something like that, I usually leave the website immediately and will never come back.
Member 4569454 6-Mar-15 4:49am    
I can agree in most cases. but im workin for a company wher we need a 1 page App..
when using swipe useres often drage form the edge of teh screen going back to the precious page.. which is annoying for the user...

to allow the back wipe i'm working on keeping track of user Position in the app so on the main screen its still works..

____ ___ ___
| 1 | 2 | 3 |
| | | |

Screen 1 is main and swipe flows in to 2 and 3 and back..
so allowing people to swipe on screen 1 would still feel natural and allow a good flow..

Try this, might work it worked for me

XML
<script type="text/javascript">
function noBack(){window.history.forward();}
noBack();
window.onload=noBack;
window.onpageshow=function(evt){if(evt.persisted)noBack();}
window.onunload=function(){void(0);}
    </script>
 
Share this answer
 
Comments
sathyanarayanan.v.m 13-Oct-11 9:00am    
which working in the browser like google chrome, mozilla, and IE but in safari which is not working
mabel ng 28-Jun-13 0:06am    
it work for me in safari, press the back button can see the previous link, but the browser cannot go back to previous page, it can auto redirect to the current website
You cannot disable the back button of a browser using the ASP.NET or JavaScript.
 
Share this answer
 
Comments
sathyanarayanan.v.m 10-Oct-11 6:05am    
i want to stop the functionality of that backspace button in safari browers
Venkatesh Mookkan 10-Oct-11 6:10am    
You cannot do that. One thing you can do is block the context menu. As CodingLover said, you can write you own WebBrowser and disable it.
 
Share this answer
 
Try this
XML
<html>
<head>
<script type="text/javascript">
window.history.forward();
function noBack(){ window.history.forward(); }
</script>
</head>
<body onload="noBack();" onpageshow="if (event.persisted) noBack();" onunload="">
...
</body>
</html>
 
Share this answer
 
Comments
Anuja Pawar Indore 13-Oct-11 10:33am    
Try this too server side
Response.Cache.SetCacheability(HttpCacheability.NoCache);

Response.Cache.SetAllowResponseInBrowserHistory(false);

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