473,416 Members | 1,733 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,416 software developers and data experts.

Response.Expires=0 have different effect on different machines, need urgent help

Need urgent help for an unsolved problem. In our ASP web application,
we creat a Back button and if user click on this button, it execute
history.go(-1) to go back to the previous page. All our users use IE
6.0 and most of them don't have problem with this button. But one user
reported everytime he click on this button, there is a pop-up window
shows up and ask him refresh and reload the page, after he clicks OK,
the previous page will be loaded with all the empty fields. So he will
lose all his input. I searched the google, it did mention there is
problem with Netscape for history.go(-1), but can not find any
articles for IE. And then I realized I use Response.Expires=0 to
disable the cache and force the browser to reload, but according to
the discussion from Internet, it might work for some type of browser,
might not work for other types of browsers. But we all use IE, I use
IE 6.0, he use either IE5.5 or IE 6.0, why it won't expire cache on
mine, but on his? The following is my code's snippet. Your help is
HIGHLY appreciated.

<% Response.Buffer = True %>
<% Response.Expires = 0 %>
<% Response.AddHeader "Pragma", "No-Cache" %>

<script LANGUAGE="javascript">
<!-- Back Function
function BackUp()
{history.go(-1);}
-->
</script>

In the html code,

<form method="post" action="NextPage.asp" id="form1" name="form1">
/* lots of other stuff */
<p align="center"><input type="button" Onclick="BackUp();" value="Go
to
Previous Page" name="Back"><input type="submit" value="Go to Next
Page"
name="Submit"></p>
</form>
Jul 23 '05 #1
1 2480
Jenny wrote:
Need urgent help for an unsolved problem. In our ASP web application,
we creat a Back button and if user click on this button, it execute
history.go(-1) to go back to the previous page. All our users use IE
6.0 and most of them don't have problem with this button. But one user
reported everytime he click on this button, there is a pop-up window
shows up and ask him refresh and reload the page, after he clicks OK,
the previous page will be loaded with all the empty fields. So he will
lose all his input. I searched the google, it did mention there is
problem with Netscape for history.go(-1), but can not find any
articles for IE. And then I realized I use Response.Expires=0 to
disable the cache and force the browser to reload, but according to
the discussion from Internet, it might work for some type of browser,
might not work for other types of browsers. But we all use IE, I use
IE 6.0, he use either IE5.5 or IE 6.0, why it won't expire cache on
mine, but on his? The following is my code's snippet. Your help is
HIGHLY appreciated.

<% Response.Buffer = True %>
<% Response.Expires = 0 %>
<% Response.AddHeader "Pragma", "No-Cache" %>

<script LANGUAGE="javascript">
<!-- Back Function
function BackUp()
{history.go(-1);}
-->
</script>

In the html code,

<form method="post" action="NextPage.asp" id="form1" name="form1">
/* lots of other stuff */
<p align="center"><input type="button" Onclick="BackUp();" value="Go
to
Previous Page" name="Back"><input type="submit" value="Go to Next
Page"
name="Submit"></p>
</form>


He probably has Internet Explorer configured to always load a new copy of
the page.

Tools -> Internet Options -> General tab

Click Settings... -> "Check for newer versions of stored pages:"

His is probably set to "Every visit to the page".

Which proves once again to handle this stuff properly, instead of
"relying" on what browsers do, even in an Intranet environment.

Store the form data in a server-side session of some sort, the "Go to
Previous Page" button should then actually retrieve the ASP document
containing the form and repopulate the form using the previously stored
session values.

This still doesn't handle what happens if the user clicks "Back" on their
browser, but that can be dealt with with a redirector page between the
form and the result pages that can identify that the user has clicked
"Back".

[form (set Session.r=0)] <--
| |
v | Session.r=1?
[redirector] --------------|
|
| Session.r!=1?
v
[result (set Session.r=1)]

If that makes no sense, try using a fixed width font.

Now if the user clicks "Back" after arriving at the [result] page, the
browser reloads [redirector], not [form]. [redirector] identifies that
they were on [result] (because Session.r is now 1) and takes them to
[form], repopulating the form with data stored in the server-side session
as well. If you don't want to return to [form] when a user clicks "Back"
on [result], that's fine, [redirector] can take ANY action, like going
back to [result] with a message that the user shouldn't click "Back" or
another page entirely.

The point is, all this is handled on the SERVER, where is can be
controlled and the behaviour is always known, and does it does not "rely"
on some behaviour in a Web browser that can't even be trusted in an
Intranet environment.

--
| Grant Wagner <gw*****@agricoreunited.com>

* Client-side Javascript and Netscape 4 DOM Reference available at:
*
http://devedge.netscape.com/library/...ce/frames.html

* Internet Explorer DOM Reference available at:
*
http://msdn.microsoft.com/workshop/a...ence_entry.asp

* Netscape 6/7 DOM Reference available at:
* http://www.mozilla.org/docs/dom/domref/
* Tips for upgrading JavaScript for Netscape 7 / Mozilla
* http://www.mozilla.org/docs/web-deve...upgrade_2.html
Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: prakash | last post by:
Hi All Can anyone explain the difference between Response.Expires & Session.Timeout Regards Prakash
1
by: Claus Pedersen | last post by:
We are building a webapplication but keep hitting a wall: The user can download files but we need to check if they are authorized to do so. We do this with a download-page and use the following...
6
by: Mark | last post by:
Hi... I've come across some weird bug with Response.Cookies. Or maybe it will be called "by design" but for the life of me I can't figure out what purpose it would serve. If you're setting a...
2
by: Promenade | last post by:
Hi, everyone... I want to avoid the user to use the navigator back button. For that reason, I tried all the possible ways to set the Expires property of the Response Object, but whatever I do, it...
2
by: qqq | last post by:
I need a page to be refreshed, even if the user navigates back to it with the 'Back' button in the browser. I've put "Reponse.expires=0" in the Page_load event, but the desired refresh isn't...
4
by: mike.biang | last post by:
I have an ASP page that is using an XMLHTTP object to request various pages from my server. I keep a single session throughout the XMLHTTP requests by bassing the ASPSESSIONID cookie through the...
5
by: simon | last post by:
well i have admin panel and agent panel. when i open admin panel and log in it works fine. but when agent opens agent panel in different pc and login and acts something like open a page or so,...
13
by: =?Utf-8?B?S2VzdGZpZWxk?= | last post by:
Hi Our company has a .Net web service that, when called via asp.net web pages across our network works 100%! The problem is that when we try and call the web service from a remote machine, one...
1
by: =?Utf-8?B?V29vZGdub21l?= | last post by:
Hi, I have use the following code to transmit a file back to the browser that worked fine on a HTC_TTyN device running windows mobile 5.0. The code executes in the onclick event of a mobilelist...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.