Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net Web Controls (http://www.velocityreviews.com/forums/f63-asp-net-web-controls.html)
-   -   CustomValidator browser back button problem (http://www.velocityreviews.com/forums/t779889-customvalidator-browser-back-button-problem.html)

Igor 05-16-2007 07:10 PM

CustomValidator browser back button problem
 
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


marss 05-24-2007 08:18 AM

Re: CustomValidator browser back button problem
 

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



All times are GMT. The time now is 05:23 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.