How to stop page going back on backspace button click in asp.net [Resolved]

Posted by Shubham under ASP.NET on 12/29/2012 | Points: 10 | Views : 18210 | Status : [Member] | Replies : 5
How to stop page going back on backspace button click in asp.net
can any one help me!!!!!!!!!!!!

Thanks&Regards:-
Shubham Choudhary
Software Engineer
www.facebook.com/shubham.kunar



Responses

Posted by: Shubham on: 12/31/2012 [Member] Starter | Points: 25

Up
0
Down

Resolved
<script type="text/javascript" language="javascript">
window.onkeydown = function(event)
{
if(event.keyCode == 8);
return false;
}
</script>

i found this code its working good on mozial...

Thanks&Regards:-
Shubham Choudhary
Software Engineer
www.facebook.com/shubham.kunar

Shubham, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Shipramaurya on: 12/29/2012 [Member] Starter | Points: 25

Up
0
Down
On each page u can use following code Inside
<head></head>
Tag of your Web Page..


<script type="text/javascript" language =javascript>
window.history.forward(1);
</script>


@Shipra - S.M. Techie

Shubham, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Shubham on: 12/31/2012 [Member] Starter | Points: 25

Up
0
Down
@Shipra
its not working!!!!!

Thanks&Regards:-
Shubham Choudhary
Software Engineer
www.facebook.com/shubham.kunar

Shubham, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ankitsrist on: 12/31/2012 [Member] Starter | Points: 25

Up
0
Down
yes shubham ur code is correct nd even shipra i generaly used ur way before,,,shubham have u noticed when we click back button on browser suddenly it goes back nd again return to the same page...for example if we are on the page2 nd clicks back button we goes to the page 1 nd suddenly return to the page 2....it looks not gud actualy m also facing this problem nd tried a lot but unable to resolve this same problem happening with shipra script....thanks

Shubham, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Prabu_Spark on: 12/31/2012 [Member] Starter | Points: 25

Up
0
Down
Hi shubham,
Try the below the code in the <head> tag.


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

With regards,
J.Prabu.
[Email:prbspark@gmail.com]

Shubham, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response