CustomValidator browser back button problem

Discussion in 'ASP .Net Web Controls' started by Igor, May 16, 2007.

  1. Igor

    Igor Guest

    Hi,

    We have problem with custom validator.
    We have a page with a dropdown and a textbox. We use only server validation.

    1. the user types a wrong value, the navigator displays an error message.
    2. then the user types a correct value, validation is ok and we redirect the
    client to next page.
    3 then user clicks on browser back button (history back) the error message
    from first try is displaying again. The wrong value filled back in textbox.

    how can we prevent this behavior?
    I searched the web, but did not found a solution.

    Thanks
     
    Igor, May 16, 2007
    #1
    1. Advertising

  2. Igor

    marss Guest

    Igor wrote:
    > Hi,
    >
    > We have problem with custom validator.
    > We have a page with a dropdown and a textbox. We use only server validation.
    >
    > 1. the user types a wrong value, the navigator displays an error message.
    > 2. then the user types a correct value, validation is ok and we redirect the
    > client to next page.
    > 3 then user clicks on browser back button (history back) the error message
    > from first try is displaying again. The wrong value filled back in textbox.
    >
    > how can we prevent this behavior?
    > I searched the web, but did not found a solution.
    >
    > Thanks


    At second time the page is loaded from cache. You can not prohibit
    user to click the Back button, but you can prohibit browser to cache
    the page. Add this code on page load:

    Response.CacheControl = "no-cache";
    Response.AddHeader("Pragma", "no-cache");

    Regards,
    Mykola
    http://marss.co.ua
     
    marss, May 24, 2007
    #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. Replies:
    3
    Views:
    7,175
  2. sylvia sil
    Replies:
    1
    Views:
    619
    Curt_C [MVP]
    Dec 29, 2004
  3. Magnus
    Replies:
    1
    Views:
    591
    Brock Allen
    May 24, 2005
  4. Mr Newbie
    Replies:
    5
    Views:
    602
    Tim_Mac
    Jan 1, 2006
  5. Author
    Replies:
    6
    Views:
    3,101
    George
    Jan 22, 2009
Loading...

Share This Page