How to disable browser back button when "logout" button click event executes.
Thanks & Regards
Manohar
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
vijayPosted Mar 25, 2011, 9:40 AM
http://vbdotnetaddict.blogspot.com/2011/02/how-to-disable-back-button-in-aspnet.html
Suthish NairPosted Mar 25, 2011, 7:29 AM
lilima baisakPosted Mar 25, 2011, 6:34 AM
Response.AddHeader("Pragma","no-cache");
Response.Expires = -1;
This will make the browser go to the server everytime the back button is clicked (for that particular page) and prevent any caching of the pages
ritesh shahPosted Mar 25, 2011, 4:55 AM
tango charliePosted Apr 27, 2010, 3:46 AM
{
Session.Abandon();
FormsAuthentication.SignOut();
Response.Cookies["TestCookies1"].Expires = DateTime.Now.AddYears(-1);
Response.Cookies["TestCookies2"].Expires = DateTime.Now.AddYears(-1);
Response.Redirect("~/login.aspx");
}
Try this on logOut, It wud help u and still thr is same issue then
try this after writing upper portion. (its customized method of doing the same :) )
write a method on the load of masterpage
function GoBack() {
if (document.cookie == "")
document.location = '<%=HttpContext.Current.Request.ApplicationPath%>' + "/login.aspx";
}
Don't forget to mark it as answer, if it works....
Raghvendr SinghPosted Apr 27, 2010, 1:10 AM
To meet your requirement there is need to add two page login.aspx and logout.aspx. Write the code eg. Response.Redirect("logout.aspx") on logout button that redirect you to Logout.aspx page.On logout.aspx page write this code.
protected void Page_Load(object sender, EventArgs e)
{
StringBuilder sb = new StringBuilder();
sb.Append("");
Page.RegisterClientScriptBlock("disable", sb.ToString());
}
when ever you redirect on logout.aspx page the above code at once redirects to login page and at seems that you are always on login page.
Lalit MPosted Apr 27, 2010, 12:57 AM
show this link will get your solution
http://geekswithblogs.net/vivek/archive/2007/02/24/107148.aspx
http://forums.asp.net/t/1401145.aspx
http://aspalliance.com/694_Preventing_Page_Review_after_Logout_with_Forms_Authentication.all