Back Button

  • Thread starter Thread starter ruca
  • Start date Start date
R

ruca

In some pages of my Web Application I need to "disable" the back button, and
for that I have this (that is not working), that is the solution found it in
the Internet:

<script language=javascript>
location.replace('myPage.aspx');
</script>

What do I have to do more?
 
There is no way to do that, or to have a 100% full proof way of preventing
the user from going back.
 
Why do you need to disable the back button ? I would try to solve the
problem caused by the back button rather than trying to disabling it because
it causes a problem (generally not easy if possible at all and the user
could always cut paste the previous URL and would get the same problem
etc...)
 
As another poster mentioned, there is no fool-proof way ... but here is a
technique I employ with a good amount of success:

<body onPageLoad="history.go(1)">

It's the equivelant of hitting the Forward button when a page loads, and
wont hit the server for either the Current or Previous page.

-- Alex Papadimoulis
 
Hi Alex,

<script language=javascript>
location.replace('myPage.aspx');
</script>

As I search in internet, many places talk about above method. So far as I
understand this replace the last page in History, and I think that if works
like this it was more useful for me. The problem it's that when I use it
nothing happens. Do you know?

Thanks anyway
Ruca
 
Back
Top