C
Chris North
I needed a mechanism to prevent a webform from resubmitting data if a user
presses the "Back" button following a submit.
To provide this mechanism, on Page_Load, I check a value in viewstate
against a value I stored in session state when creating the original page.
If the 2 values don't match, I do
Response.Redirect(Request.Url.AbsoluteUri, true);
So that the page is rebuilt without the submitted form data. This works
perfectly in IE6, but if I test using IE 5.0, when the back button causes
this code to fire, the browser displays a message box with the following
error :
"Internet Explorer cannot open the Internet site http://...<correct
URL>...
A redirection problem occured."
This error only occurs when the form has posted data to the server. If I
stimulate a Response.Redirect in other scenarios, it works fine.
I'm not adding anything to the response (or indeed executing any other
code) before performing the check described above.
If anybody has any ideas, it'll save me pulling anymore hair out! Thanks in
advance.
presses the "Back" button following a submit.
To provide this mechanism, on Page_Load, I check a value in viewstate
against a value I stored in session state when creating the original page.
If the 2 values don't match, I do
Response.Redirect(Request.Url.AbsoluteUri, true);
So that the page is rebuilt without the submitted form data. This works
perfectly in IE6, but if I test using IE 5.0, when the back button causes
this code to fire, the browser displays a message box with the following
error :
"Internet Explorer cannot open the Internet site http://...<correct
URL>...
A redirection problem occured."
This error only occurs when the form has posted data to the server. If I
stimulate a Response.Redirect in other scenarios, it works fine.
I'm not adding anything to the response (or indeed executing any other
code) before performing the check described above.
If anybody has any ideas, it'll save me pulling anymore hair out! Thanks in
advance.