Possible Duplicate:
detect back button click in browser
I have two pages, Page1 and Page2. When moving from Page1 to Page2 by clicking a link, I tend to store the conditions required to restore the state of Page1 on clicking browser back button when on Page2.
I am using the below function to clear the cache,
protected override void OnInit(EventArgs e)
{
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetNoStore();
Response.Cache.SetExpires(DateTime.MinValue);
base.OnInit(e);
}
so that I can reload the page based on stored conditions in the cookie. But the issue is how to identify if I have pressed the browser back button or the menu link to come to Page1.
Update:
i just landed on this link detect back button click in browser but it doesn't work for me