Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Dec 21, 2012 03:49 AM by ram.chittala
Participant
960 Points
458 Posts
Apr 03, 2012 06:47 AM|LINK
hi all
how to disable back button in aspx page
All-Star
31378 Points
5422 Posts
Apr 03, 2012 06:56 AM|LINK
hi, Refer : http://www.codeproject.com/Articles/11225/Disabling-browser-s-back-functionality-on-sign-out
http://www.csharpaspnetarticles.com/2009/04/disable-browser-back-button-javascript.html
http://www.aspsnippets.com/Articles/Disable-Browser-Back-Button-Functionality-using-JavaScript.aspx
http://forums.asp.net/t/1639951.aspx/1
Member
120 Points
51 Posts
Apr 03, 2012 07:24 AM|LINK
Hai,
I think it will Helpful to you..............
<script type = "text/javascript" >
function preventBack(){window.history.forward();}
setTimeout("preventBack()", 0);
window.onunload=function(){null};
</script>
If there are two pages Page1and Page2 and Page1 redirects to Page2
Hence to prevent user from visiting Page1 using Back Button you will need to place the above script in the head section of Page1
6 Points
3 Posts
Dec 21, 2012 03:49 AM|LINK
Prevent back button action not to redirect previous url while typing in the textbox or any input control in asp.net MVC4 http://techiebrains.blogspot.in/2012/12/prevent-back-button-action-not-to.html
$(document).keydown(function(e) { var doPrevent; if (e.keyCode == 8) { var d = e.srcElement || e.target; if (d.tagName.toUpperCase() == 'INPUT' || d.tagName.toUpperCase() == 'TEXTAREA') { doPrevent = d.readOnly || d.disabled; } else doPrevent = true; } else doPrevent = false; if (doPrevent) e.preventDefault(); });
narasappa
Participant
960 Points
458 Posts
how to disable Back button
Apr 03, 2012 06:47 AM|LINK
hi all
how to disable back button in aspx page
ravi.jadiyannavar@gmail.com
Pls Mark This Post As Answer If it Helps U..
Thanku
karthicks
All-Star
31378 Points
5422 Posts
Re: how to disable Back button
Apr 03, 2012 06:56 AM|LINK
hi, Refer : http://www.codeproject.com/Articles/11225/Disabling-browser-s-back-functionality-on-sign-out
http://www.csharpaspnetarticles.com/2009/04/disable-browser-back-button-javascript.html
http://www.aspsnippets.com/Articles/Disable-Browser-Back-Button-Functionality-using-JavaScript.aspx
http://forums.asp.net/t/1639951.aspx/1
Karthick S
rupeshkura
Member
120 Points
51 Posts
Re: how to disable Back button
Apr 03, 2012 07:24 AM|LINK
Hai,
I think it will Helpful to you..............
<div><script type = "text/javascript" >
function preventBack(){window.history.forward();}
setTimeout("preventBack()", 0);
window.onunload=function(){null};
</script>
If there are two pages Page1and Page2 and Page1 redirects to Page2
Hence to prevent user from visiting Page1 using Back Button you will need to place the above script in the head section of Page1
</div>ram.chittala
Member
6 Points
3 Posts
Re: how to disable Back button
Dec 21, 2012 03:49 AM|LINK
Prevent back button action not to redirect previous url while typing in the textbox or any input control in asp.net MVC4
http://techiebrains.blogspot.in/2012/12/prevent-back-button-action-not-to.html
$(document).keydown(function(e) {
var doPrevent;
if (e.keyCode == 8) {
var d = e.srcElement || e.target;
if (d.tagName.toUpperCase() == 'INPUT' || d.tagName.toUpperCase() == 'TEXTAREA') {
doPrevent = d.readOnly || d.disabled;
}
else
doPrevent = true;
}
else
doPrevent = false;
if (doPrevent)
e.preventDefault();
});
ram.chittala
Member
6 Points
3 Posts
Re: how to disable Back button
Dec 21, 2012 03:49 AM|LINK
Prevent back button action not to redirect previous url while typing in the textbox or any input control in asp.net MVC4
http://techiebrains.blogspot.in/2012/12/prevent-back-button-action-not-to.html
$(document).keydown(function(e) {
var doPrevent;
if (e.keyCode == 8) {
var d = e.srcElement || e.target;
if (d.tagName.toUpperCase() == 'INPUT' || d.tagName.toUpperCase() == 'TEXTAREA') {
doPrevent = d.readOnly || d.disabled;
}
else
doPrevent = true;
}
else
doPrevent = false;
if (doPrevent)
e.preventDefault();
});