Thursday, April 9, 2009

Clear browser history

The following code under page_load will not store page in browser memory (cache).
it will clear the browser memory...

If IsPostBack = False Then
HttpContext.Current.Response.Buffer = True
HttpContext.Current.Response.Expires = 0
HttpContext.Current.Response.ExpiresAbsolute = DateAndTime.Now.AddDays(-1)
Page.Response.Cache.SetCacheability(HttpCacheability.NoCache)
Page.Response.Cache.SetNoStore()
End If

No comments:

Post a Comment