By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,968 Members | 1,871 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,968 IT Pros & Developers. It's quick & easy.

Back Button

P: n/a
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?
--
Programming ASP.NET with VB.NET
Thank's (if you try to help me)
Hope this help you (if I try to help you)
ruca
Nov 18 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
There is no way to do that, or to have a 100% full proof way of preventing
the user from going back.

"ruca" <ru***@iol.pt> wrote in message
news:%2******************@tk2msftngp13.phx.gbl...
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?
--
Programming ASP.NET with VB.NET
Thank's (if you try to help me)
Hope this help you (if I try to help you)
ruca

Nov 18 '05 #2

P: n/a
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...)
"ruca" <ru***@iol.pt> a écrit dans le message de
news:%2******************@tk2msftngp13.phx.gbl...
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?
--
Programming ASP.NET with VB.NET
Thank's (if you try to help me)
Hope this help you (if I try to help you)
ruca

Nov 18 '05 #3

P: n/a
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

"ruca" <ru***@iol.pt> wrote in message
news:%2******************@tk2msftngp13.phx.gbl...
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?
--
Programming ASP.NET with VB.NET
Thank's (if you try to help me)
Hope this help you (if I try to help you)
ruca

Nov 18 '05 #4

P: n/a
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
"Alex Papadimoulis" <al***@papadimoulis.com> escreveu na mensagem
news:10*************@corp.supernews.com...
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

"ruca" <ru***@iol.pt> wrote in message
news:%2******************@tk2msftngp13.phx.gbl...
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?
--
Programming ASP.NET with VB.NET
Thank's (if you try to help me)
Hope this help you (if I try to help you)
ruca


Nov 18 '05 #5

P: n/a
Where should I put this code:
----------------------------------
<script language=javascript>
location.replace('myPage.aspx');
</script>


----------------------------------
to simulate the "disable" back button?

--
Programming ASP.NET with VB.NET
Thank's (if you try to help me)
Hope this help you (if I try to help you)
ruca
Nov 18 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.