Who is online?  85 guests and 0 members
home » blogs » vivek_iit » 'Disable' Back Browser Button ASP.NET
  Rate This Blog Entry:  register  or  login

Author

vivek_iit Vivek Thakur (Member since: 11/27/2008 11:54:25 AM)
I am one of the administrators at CodeAsp.Net and I love programming, architecting solutions, code reviews, teaching and writing about ASP.NET.

View Vivek Thakur 's profile

Product Spotlight

ASP.NET Hosting Spotlight

Comments (7)

Paul
4/10/2009 9:58:21 AM Anonymous User said:
I tried this on ASP .NET 2.0 and it does not seem to work - where are you putting that code to get it to work?
by
Faheem
8/28/2009 4:35:03 AM Anonymous User said:
You have to put this Response.Cache.SetCacheability(HttpCacheability.NoCache); Response.Cache.SetExpires(DateTime.Now); in Page_Load of final page from which u don't want to go back its working
by
Kev
10/28/2009 1:40:23 PM Kev said:
Code doesn't appear to work.
by
lokesh
12/28/2009 1:00:40 AM lokesh said:
this code doesn't work at all.. i've an appl in which when i logout i should not be able to go bak to previous page my session should end there. dont tell abt session.abandon() method this also doesn't work
by
Samar
1/25/2010 2:16:43 AM Samar said:
Hello I m putting this following code in a final page Load(the form I don't want to go back) but it is not working Response.Cache.SetCacheability(HttpCacheability.NoCache); Response.Cache.SetExpires(DateTime.Now); I M using .net 2.0 framework
by
hassaanz
7/4/2010 10:59:52 PM Hassaan Khawer said:

try this in ur logout button/link..its works for me...as it refreshs the page after the Session.abondon(); so its not possible to go bak to ur previous page without logging again..

 

protected void logOut_b_Click(object sender, ImageClickEventArgs e)
    {
        Session.Abandon();
        Response.AddHeader("Refresh",Convert.ToString((Session.Timeout * 0)));
        if(Session["Name"].ToString()=="")
        {
           Server.Transfer("login.aspx");
        }
    }

 

 

 

by
hassaanz
7/4/2010 11:00:55 PM Hassaan Khawer said:

try this in ur logout button/link..its works for me...as it refreshs the page after the Session.abondon(); so its not possible to go bak to ur previous page without logging again..

 

protected void logOut_b_Click(object sender, ImageClickEventArgs e)
    {
        Session.Abandon();
        Response.AddHeader("Refresh",Convert.ToString((Session.Timeout * 0)));
        if(Session["Name"].ToString()=="")
        {
           Server.Transfer("login.aspx");
        }
    }

 

 

 

by

Leave a comment


 
Type the characters:
 *
 
   

Join CodeAsp.Net for FREE Today!

It's fast, easy and free! Submit articles, get your own blog, ask questions & give answers in the forums, and become a better developer, faster.

enter your email address:

Blogs RSS Feed

Vivek Thakur's latest blog posts

Blogs RSS Feed

Latest community blog posts