CustomValidator browser back button problem

I

Igor

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
 
M

marss

Igor said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top