can we disable back button of the browser?

admin

Administrator
Staff member
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 neelankavildunno, 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...:ohai 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
austinim sure u could close it with javascriptAsp.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.Austin,

Exactly what is it that you are trying to prevent by not allowing the user to go back?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.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?When you're right you're right and you're right.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!There is no way to disable the back button using Javascript.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: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............

Austinhi

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?Is there a sample page which has this that I could check out?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).actually we cannot disable back button..
but there are some tricks to disable user from hit the button :)

this link may help :rolleyes: :-
<!-- m --><a class="postlink" href="http://www.htmlgoodies.com/tutorials/buttons/article.php/3478911">http://www.htmlgoodies.com/tutorials/bu ... hp/3478911</a><!-- m -->

good luck !!!actually we cannot disable back button..
but there are some tricks to disable user from hit the button :)

this link may help :rolleyes: :-
<!-- m --><a class="postlink" href="http://www.htmlgoodies.com/tutorials/buttons/article.php/3478911">http://www.htmlgoodies.com/tutorials/bu ... hp/3478911</a><!-- m -->

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