19 Kasım 2007 Pazartesi

Page Expire Problem When Browser's Back Button is Clicked


As a result of a search form submission, results are displayed as links. The user clicks any links and goes to that page. When back button is pressed, browser gives an error.

In detail,

1. User submits an HTML form that does a search.
2. User sees a list of search results, each hyperlinked to a details screen.
3. User clicks one of the "details" hyperlinks.
4. User sees the details screen.
5. User clicks browser's "Back" button to return to the screen in Step 2.
6. Browser gives confusing message about having to resubmit POST data. In Firefox this is a dialog box with OK/Cancel, and IE this is a white screen with the message:

"Warning: Page has Expired The page you requested was created using information you submitted in a form. This page is no longer available. As a security precaution, Internet Explorer does not automatically resubmit your information for you. To resubmit your information and view this Web page, click the Refresh button."


Handle the form inside javascript, and submit search using request parameters.

Not a Form, a text input field and a link:

Javascript Code:function ProcessSearchSubmit() {
if ( document.getElementById('searchInputId') ) {
linkToRedirect += document.getElementById('searchInputId').value;
setTimeout( "window.location.href = linkToRedirect", 0 );

Hiç yorum yok: