473,405 Members | 2,261 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,405 software developers and data experts.

Help! Subsequent Get Requests using xmlhttp return identical results

Has anybody experienced the following? The below Get request is called
when a button on the page is clicked:

function GetTranscript(){
var oSend = new ActiveXObject("Msxml2.XMLHTTP.3.0");
oSend.Open("GET", "transcript.aspx", true);
oSend.onreadystatechange = function() {
if (oSend.readyState == 4) {
alert(oSend.responseText);
}
}
oSend.send(null);
oSend = null;
return false;
}

The page transcript.aspx returns the current date, i.e.
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
Response.Write(System.DateTime.Now.ToLongTimeStrin g());
Response.End();
}

The first call through xmlhttp works great. Subsequent calls return
the same exact time.

HELP! Dont know what else to do.

dead in the water,
Tom

Jul 23 '05 #1
4 1655
tlang wrote:
Has anybody experienced the following? The below Get request is called
when a button on the page is clicked:

function GetTranscript(){
var oSend = new ActiveXObject("Msxml2.XMLHTTP.3.0");
It may be that it's getting the page from a cache somewhere, but never
experienced this problem. What you can try doing is making the file name
unique so that it forces it from the server:

myFile = "transcript.aspx?" + new Date().getTime();
oSend.Open("GET", "transcript.aspx", true);


oSend.Open("GET",myFile,true);

It may work, it may not, but worth trying.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Jul 23 '05 #2

Thanks Randy. This worked:
<script language="javascript">
function GetTranscript(){
var oSend = new ActiveXObject("Msxml2.XMLHTTP.3.0");
myFile = "transcript.aspx?time=" + new Date().getTime();
oSend.Open("GET", myFile, true);
oSend.onreadystatechange = function() {
if (oSend.readyState == 4) {
alert(oSend.responseText);
oSend = null;
}
}
oSend.send(null);
return false;
}
</script>

Not sure why the output of the aspx file was cached. I thought the
point of aspx files is that their contents is dynamic. I would think
making it static would be an explicit property setting. I'll try to
find out more info on that.

Tom

Jul 23 '05 #3
>Not sure why the output of the aspx file was cached. I thought
the point of aspx files is that their contents is dynamic.


What you saw is normal.

Page contents can be dynamic, but unless you specify a different URL
(or use a POST instead of a GET), the browser will use the page with
the same URL from cache. (Assuming you haven't used an expiration date
or other methods to prevent that.)

We have an internal site that makes extensive use of cached files to
speed up usage over dialup. To force a download, we use the method as
was suggested... adding the date to create a new version parameter.

Kev

Jul 23 '05 #4
Randy is right... transcript.aspx is being cached.... I've had the same
problem, and it can be quickly solved just by sending no-cache request
headers... For IE, the following alone will do it:

oSend.setRequestHeader("If-Modified-Since","Wed, 15 Nov 1995 04:58:08
GMT");

Don't know for other browsers, but try these:

oSend.setRequestHeader("Expires", "Wed, 15 Nov 1995 04:58:08 GMT");
oSend.setRequestHeader("Last-Modified", "Wed, 15 Nov 1995 04:58:08
GMT");
oSend.setRequestHeader("Cache-Control", "no-cache, must-revalidate");
oSend.setRequestHeader("Pragma", "no-cache");

Let us know if it worked..

[ ]'s
Diego

Jul 23 '05 #5

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

Similar topics

21
by: Dave | last post by:
After following Microsofts admonition to reformat my system before doing a final compilation of my app I got many warnings/errors upon compiling an rtf file created in word. I used the Help...
9
by: Tom | last post by:
A question for gui application programmers. . . I 've got some GUI programs, written in Python/wxPython, and I've got a help button and a help menu item. Also, I've got a compiled file made with...
6
by: d.warnermurray | last post by:
I am doing a project for school that involves creating help files for a html authoring tool. If you could help me with answers to some questions it would really help. 1. What tasks do you expect...
2
by: BT Openworld | last post by:
I have just had to upgrade to Access 2003 as Access 97 EMail (SendObject) doesn't work when loaded on Windows XP. I'm finding my way around Access 2003 but my biggest problem is getting...
27
by: Bruce Dodds | last post by:
I recently started using Access 2003 for the first time. I wanted to pass on some comments about the Help system to Access MVPs who frequent this board. I'm doing this in the hope that some of...
5
by: dixie | last post by:
I was wondering if there is a way of doing a simple help system with either viewing a page in a browser or looking at a definite page in a .pdf file when a help button was pushed on an Access...
3
by: lord.zoltar | last post by:
I've managed to get a nice little chm help system written. Now I need to display it! I added a HelpProvider to my MDIParent form and set the namespace of the HelpProvider to be the help file. So...
10
by: JonathanOrlev | last post by:
Hello everybody, I wrote this comment in another message of mine, but decided to post it again as a standalone message. I think that Microsoft's Office 2003 help system is horrible, probably...
1
by: trunxnirvana007 | last post by:
'UPGRADE_WARNING: Array has a new behavior. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="9B7D5ADD-D8FE-4819-A36C-6DEDAF088CC7"' 'UPGRADE_WARNING: Couldn't resolve...
0
by: hitencontractor | last post by:
I am working on .NET Version 2003 making an SDI application that calls MS Excel 2003. I added a menu item called "MyApp Help" in the end of the menu bar to show Help-> About. The application...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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...

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.