Click to See Complete Forum and Search --> : can we disable back button of the browser?


austin
12-30-2004, 04:46 AM
hai every one
today only i started a thread in wHich i asked that can u access browser functions using ASP.net in reply i from two of the members(to whom i am really greatful) it can be only done using JavaScript?
So i am changing my question all i want to do is disable back button of the browser or atleast inform the user that making use of back button of the browser is not a valid step.

do any one have the answer....

keep smiling
austin neelankavil

LiLcRaZyFuZzY
12-30-2004, 05:39 AM
dunno, u could open a new window each time, so the back button is disabled, i think, im not sure bout all browsers...and that way really suck...:o

austin
12-30-2004, 06:01 AM
hai LiLcRaZyFuZzY
its a inovative yet simple ground to earth solution to my porblem but then it will create new problem that are.....
1 .i need a way to close the old window.
2. and along with this i have been using Response.Redirect ("loction.aspx") and it just make use of already open browser

so in order to implement ur idea i will have to close a browser and open a new one also..........

but thanks for ur suggestion

keep smiling
austin

LiLcRaZyFuZzY
12-30-2004, 06:08 AM
im sure u could close it with javascript

PeOfEo
12-30-2004, 03:08 PM
Asp.net cannot do anything to the browser. It cannot open or close windows, it cannot play with any of the buttons. If you want to interact with the client like that you have to use javascript (or an activx control which will only run for ie users with it enabled). Javascript is no guarantee either, some users do not support it, others disable it.

Cstick
12-30-2004, 05:49 PM
Austin,

Exactly what is it that you are trying to prevent by not allowing the user to go back?

PDuncan
01-04-2005, 05:20 PM
Try placing your main page in an IFRAME tag. Keep your navigation buttons outside the tag, have the tag navigate the links in the IFRAME.

Just an idea.

PeOfEo
01-04-2005, 11:10 PM
Originally posted by PDuncan
Try placing your main page in an IFRAME tag. Keep your navigation buttons outside the tag, have the tag navigate the links in the IFRAME.

Just an idea. I am pretty sure that is not going to work, the back button will work even with frame schemes.

Austin are you going for content expiration?

PDuncan
01-05-2005, 10:39 AM
When you're right you're right and you're right.

sjhallifax
04-25-2005, 03:50 PM
Austin -
Were you ever able to find a way to diable the back button? I'd be interested in doing the same thing. If you were able to find something, let me know. Thanks!

felgall
04-25-2005, 04:22 PM
There is no way to disable the back button using Javascript.

MikeFlyer
04-26-2005, 11:41 AM
dunno, u could open a new window each time, so the back button is disabled, i think, im not sure bout all browsers...and that way really suck...:o

but this is not a solution at all, or will find all your web site in the task bar :rolleyes:

austin
04-27-2005, 03:12 AM
hi

inside the html, inside form tag on onload set the following

if(window.history .length>0)
{
window.history.go(4);
}

cannt say its perfect answer but still it works......... u will be redirected to the current page even if u try to go back using the back button on the browser............

Austin

PeOfEo
04-27-2005, 12:04 PM
hi

inside the html, inside form tag on onload set the following

if(window.history .length>0)
{
window.history.go(4);
}

cannt say its perfect answer but still it works......... u will be redirected to the current page even if u try to go back using the back button on the browser............

Austin
With javascript nothing is certain because not all browsers support it and browsers will read it diffferently.

Also the question remains why on earth would you want to disable the back button. What will that do that is helpful to you?

sjhallifax
05-05-2005, 09:28 AM
Is there a sample page which has this that I could check out?

PeOfEo
05-05-2005, 05:04 PM
Is there a sample page which has this that I could check out?
There is no way to completely disable a browsers back button. It is definatly not possible using asp.net and with javascript one could choose not to read that javascript (my browser allows me to disable it and many browsers do not support it).

zephyr5v
06-19-2005, 12:33 AM
actually we cannot disable back button..
but there are some tricks to disable user from hit the button :)

this link may help :rolleyes: :-
http://www.htmlgoodies.com/tutorials/buttons/article.php/3478911

good luck !!!

PeOfEo
06-19-2005, 02:50 AM
actually we cannot disable back button..
but there are some tricks to disable user from hit the button :)

this link may help :rolleyes: :-
http://www.htmlgoodies.com/tutorials/buttons/article.php/3478911

good luck !!!
Oh you mean simple tricks to make your website inaccessible? ;)