Click here to Skip to main content
15,884,473 members
Please Sign up or sign in to vote.
3.50/5 (2 votes)
See more:
I have a login control, and when I click on the login button I go to next page.

I click on backspace and I go to previous page.

I want to disable backspace button
Posted
Updated 22-May-11 10:49am
v4
Comments
Dalek Dave 22-May-11 16:49pm    
Edited for Grammar and Readability.

A couple of things

1 - the header is the place for a brief description, not your whole question
2 - your question is the place to show you've done more than ask us to do your work for you
3 - the tagging helps people find the right questions, so put ASP.NET if you're using it
4 - only the most inexperienced and incompetent programmers bother trying to disable the back button. There is no way of doing it that cannot be easily defeated. People who try to do this, usually try because their code is broken in other ways. These can all be fixed. Fix them, don't add hacks to your code. Overall, I feel like you need to not be allowed to work on any site that needs security, and that you need to do a lot of reading before you consider doing such a thing.
 
Share this answer
 
Comments
Fabio V Silva 22-May-11 15:44pm    
My 5.
This question gets asked a lot...
This page will stop the back button from working[^]


However Alt+LeftArrow will still function.
 
Share this answer
 
Comments
Wonde Tadesse 22-May-11 17:05pm    
My 5:)
ambarishtv 23-May-11 3:47am    
My 5
MIDL
HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache);
        HttpContext.Current.Response.Cache.SetNoServerCaching();
        HttpContext.Current.Response.Cache.SetNoStore();
        Session.Abandon();



and

XML
<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>
 
Share this answer
 
Comments
ambarishtv 23-May-11 3:47am    
My 5:)

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