How can I avoid back button after logged out
-
I am using Asp.Net 2.0. How can I avoid using back button after logged out from the page. Thanks in adv.
Balasubramanian K.
-
I am using Asp.Net 2.0. How can I avoid using back button after logged out from the page. Thanks in adv.
Balasubramanian K.
Check here [Disable back button using javascript]
-
Check here [Disable back button using javascript]
-
I am using Asp.Net 2.0. How can I avoid using back button after logged out from the page. Thanks in adv.
Balasubramanian K.
Just search it in CP Q&A forum. This has been asked number of times: one of the ways: Try...In you logout event:
protected void LogOut()
{
Session.Abandon();
string nextpage = "Logoutt.aspx";
Response.Write("<script language=javascript>");
Response.Write("{");
Response.Write(" var Backlen=history.length;");
Response.Write(" history.go(-Backlen);");
Response.Write(" window.location.href='" + nextpage + "'; ");
Response.Write("}");
Response.Write("</script>");
} -
I am using Asp.Net 2.0. How can I avoid using back button after logged out from the page. Thanks in adv.
Balasubramanian K.
This particular question has been asked so many times. I am not able to provide you the codeproject search link for search "disable back". You may try searching. You would get a lot of hits. You may also search Google for "disable back button" if that does not satisfies you. Here are few links from codeproject: http://www.codeproject.com/Questions/73968/Disable-back-option-after-logout.aspx[^] http://www.codeproject.com/Questions/53733/how-to-disable-browser-back-button.aspx[^] Hope this helps!
..Go Green..
modified on Wednesday, June 2, 2010 5:43 AM
-
Just search it in CP Q&A forum. This has been asked number of times: one of the ways: Try...In you logout event:
protected void LogOut()
{
Session.Abandon();
string nextpage = "Logoutt.aspx";
Response.Write("<script language=javascript>");
Response.Write("{");
Response.Write(" var Backlen=history.length;");
Response.Write(" history.go(-Backlen);");
Response.Write(" window.location.href='" + nextpage + "'; ");
Response.Write("}");
Response.Write("</script>");
} -
This is the second time today when I was answering a question and as soon as I finished answering, I saw your answer above me. :rolleyes: *I hope you got my previous message in the notification mail.
..Go Green..
Done! Sure... tell me how can i help..
modified on Wednesday, June 2, 2010 5:58 AM
-
I am using Asp.Net 2.0. How can I avoid using back button after logged out from the page. Thanks in adv.
Balasubramanian K.
The best option is (1) check for a valid session object as the first statement to be executed for your page load event handler. If there is no session (or session object is null you write code to redirect user to login and force user to create a session. Assumption is, while logging out code is written to clear Session which has been created at the time of "Login". (2) Sometime, developer creates "Base" page class and write this kind of session checking in base page itself so that every derived page class follows the same. This way, you can set aside any dependency of javascript. Hope it helps you,
Thanks, Arindam D Tewary
-
The best option is (1) check for a valid session object as the first statement to be executed for your page load event handler. If there is no session (or session object is null you write code to redirect user to login and force user to create a session. Assumption is, while logging out code is written to clear Session which has been created at the time of "Login". (2) Sometime, developer creates "Base" page class and write this kind of session checking in base page itself so that every derived page class follows the same. This way, you can set aside any dependency of javascript. Hope it helps you,
Thanks, Arindam D Tewary
Thanks to all.
Balasubramanian K.