Using the browser back arrow

Discussion in 'ASP .Net' started by =?Utf-8?B?RGVuaXNl?=, Jul 27, 2005.

  1. In my application, I am setting cookies used for other pages based on the
    current row selected. But when the user presses the 'back' button, the
    pageload event does not get called and the record they are viewing does not
    match the cookie and can lead to data entry errors. Is there a way to
    resolve this?

    Thanks,
    Denise
    =?Utf-8?B?RGVuaXNl?=, Jul 27, 2005
    #1
    1. Advertising

  2. When browser back button clicked, the page is loaded from users cache.. one
    way is to expire the first page , so that when the user clicks back button
    from second page, the browser shows a message that page is not available,
    forcing them to use the navigation provided in the site ..

    private void Page_Load(object sender, System.EventArgs e)
    {
    ExpirePageCache();
    //.......rest of the page_load logic....................
    }


    /// <summary>
    /// This function prevent the page being retrieved from broswer cache
    /// </summary>
    private void ExpirePageCache()
    {
    Response.Cache.SetCacheability(HttpCacheability.NoCache);
    Response.Cache.SetExpires(DateTime.Now-new TimeSpan(1,0,0));
    Response.Cache.SetLastModified(DateTime.Now);
    Response.Cache.SetAllowResponseInBrowserHistory(false);
    }

    Sreejith

    "Denise" wrote:

    > In my application, I am setting cookies used for other pages based on the
    > current row selected. But when the user presses the 'back' button, the
    > pageload event does not get called and the record they are viewing does not
    > match the cookie and can lead to data entry errors. Is there a way to
    > resolve this?
    >
    > Thanks,
    > Denise
    =?Utf-8?B?U3JlZWppdGggUmFt?=, Jul 27, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rob R. Ainscough
    Replies:
    0
    Views:
    696
    Rob R. Ainscough
    Jul 20, 2005
  2. acorn
    Replies:
    4
    Views:
    79,910
    acorn
    Feb 24, 2006
  3. Author
    Replies:
    6
    Views:
    3,064
    George
    Jan 22, 2009
  4. Mel Smith

    'Back Button (Arrow)' Puzzle ?

    Mel Smith, Jul 26, 2010, in forum: HTML
    Replies:
    42
    Views:
    1,794
    Mel Smith
    Jul 30, 2010
  5. fulio pen
    Replies:
    0
    Views:
    363
    fulio pen
    Apr 13, 2011
Loading...

Share This Page