Disabling Back Button
-
Hello everybody, I'm working with asp.net and my project has login interface which accepts user's information and redirects to another page. After a user has logedout s/he never return to that page,but this doesn't happen,in contrast, when the user uses the back button s/he can again visit the page. I want to disable the back button, how can I? Or is there another method to do that? Thank you.
-
Hello everybody, I'm working with asp.net and my project has login interface which accepts user's information and redirects to another page. After a user has logedout s/he never return to that page,but this doesn't happen,in contrast, when the user uses the back button s/he can again visit the page. I want to disable the back button, how can I? Or is there another method to do that? Thank you.
You can't. You are seeing the browser cached version of the page and any well written application will not allow to proceed using the secured page. Each page load should check the session existence and do necessary redirects.
Navaneeth How to use google | Ask smart questions
-
Hello everybody, I'm working with asp.net and my project has login interface which accepts user's information and redirects to another page. After a user has logedout s/he never return to that page,but this doesn't happen,in contrast, when the user uses the back button s/he can again visit the page. I want to disable the back button, how can I? Or is there another method to do that? Thank you.
-
Hello everybody, I'm working with asp.net and my project has login interface which accepts user's information and redirects to another page. After a user has logedout s/he never return to that page,but this doesn't happen,in contrast, when the user uses the back button s/he can again visit the page. I want to disable the back button, how can I? Or is there another method to do that? Thank you.
Disabled Back Button is not a good idea. And even if you check the Session object, still browser will load cached page as its not a postback. you can use following property to expire the content on the client side. but still it will not be real-time.
Response.Expires Response.ExpiresAbsolute
on the Logout page try setting
Response.ExpiresAbsolute
to the (DateTime.Now.AddSecond(5)) and see if that works. -
Hello everybody, I'm working with asp.net and my project has login interface which accepts user's information and redirects to another page. After a user has logedout s/he never return to that page,but this doesn't happen,in contrast, when the user uses the back button s/he can again visit the page. I want to disable the back button, how can I? Or is there another method to do that? Thank you.
function noBack() { window.history.forward(); } noBack(); window.onload=noBack; window.onpageshow=function(evt){if(evt.persisted)noBack();} window.onunload=function(){void(0);} this javascript may help you
-
Hello everybody, I'm working with asp.net and my project has login interface which accepts user's information and redirects to another page. After a user has logedout s/he never return to that page,but this doesn't happen,in contrast, when the user uses the back button s/he can again visit the page. I want to disable the back button, how can I? Or is there another method to do that? Thank you.
People ask this all the time. It's a stupid request. The answer you were given, is easily defeated. Instead, tell us how your code is broken or poorly written so that you need to do this ( i.e. tell us why you want to do it, I am sure it will mean we can tell you how to fix your code ).
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
-
You can't. You are seeing the browser cached version of the page and any well written application will not allow to proceed using the secured page. Each page load should check the session existence and do necessary redirects.
Navaneeth How to use google | Ask smart questions
Thank you all for your help.
-
You cannot. Perfectly. Although there are plenty of ways available through web of doing this.
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
Thank you for your help.
-
Thank you all for your help.
You are welcome. You may also reconsider your websites navigation model. Something like Post/Redirect/Get[^].
Best wishes, Navaneeth