Home > Code > ASP.NET > Avoid back button after logout in asp.net application

Avoid back button after logout in asp.net application

by Spidy   on May 15, 2011   Category: ASP.NET   |  Views: 9646    |  Points: 25   |  Silver 

We regularly facing this kind of issue in all the web applications, below is the sample code for avoid using back button, to view the secure or restricted page content in the application after logout.

protected void LinkLogout_Click(object sender, EventArgs e)
Response.Buffer = true;
Response.ExpiresAbsolute = DateTime.Now.AddDays(-1d);
Response.Expires = -1000;
Response.CacheControl = "no-cache";
Response.Redirect("login.aspx", true);
catch (Exception ex)

Post Code  |  Code Snippet Home

User Responses

No response found, be the first to review this code snippet.

Submit feedback about this code snippet

Please sign in to post feedback

Latest Posts