Refresh Page After Back Button Click

I have to do something like this in a catalog where the browse page 
needs to be loaded from the DB on every load because when you hit a 
product page it calls out to a 3rd party to get updated info, and then 
save it if it should be updated. This is so when you hit the back button
 like you're saying the data is reloaded. What I've done is added this 
into the page and it seems to work fine in all browsers. 
 
 
 
public class ProductBrowser : Page
{
    protected override void OnInit(EventArgs e)
    {
        Response.Cache.SetCacheability(HttpCacheability.NoCache);
        Response.Cache.SetNoStore();
        Response.Cache.SetExpires(DateTime.MinValue);

        base.OnInit(e);
    }
}

0 comments:

Post a Comment