Disable Browser Back Button using csharp

Disable Firefox and IE Back Button in Asp.net


public void ClearBrowserCache(){      HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache); 
HttpContext.Current.Response.Cache.SetExpires(DateTime.Now); HttpContext.Current.Response.Cache.SetExpires(DateTime.Now.AddSeconds(-1));
      HttpContext.Current.Response.Cache.SetNoStore();
     }

call this method in each and every page load Event.

note:This functionality will not work when you call Server.Transfer for page redirection.

1 comments :

Good article. its very useful

You can submit your .net related article links on http://www.dotnettechy.com to get more traffic

Post a Comment