473,804 Members | 1,974 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

XMLhttp request problem

Hi all

i am using asp.net v2.0

In one of my page i am calling another page using xml http , this is
working fine but first time only ,

I am sending the request on click of button , when i click the button
second time, it's returning the previous response and it's not even
calling that page again, where could be the problem.

client side (aspx page 1- javascript)

var http=new ActiveXObject(" Msxml2.XMLHTTP" );
http.open("GET" ,"Gensparql.asp x",false);
http.send();
if(http.readySt ate == 4)
{
if(http.respons eText!=null && http.responseTe xt!='' )
{
//my process
}
}

server side (aspx page 2)

Response.Clear( );
Response.Conten tType = "text/xml";
Response.Write( retVal);
Response.End();

//second time returning same previous output and not calling the aspx
page 2
Hope u understand my problem,i am in urgent, Thanks in advance

Oct 12 '05
11 1600

Richard Cornford wrote:
<snip>
It is considerably easier to say "just make sure to use a different
random number for each call" (assuming "call" is acceptable terminology
here (which it probably isn't)) than to actually do it. Remember that
you would have to be keeping track of which random numbers had been
used, even between sessions, as it would not be too good if the browser
decided to deliver content that it had downloaded in a previous session
from its cache in response to a request in a later one.
Agreed. However, the odds that the same random number would be
generated within the lifespan of the cache is sufficiently miniscule to
preclude the need to keep track of the used numbers. (Especially
considering the example I used provided for up to 1 quadrillion
numbers.)
That is why using the millisecond time in this context has been
proposed, as each time will be unique (at least so long as no two times
are requested within about 60 milliseconds, at most) and it is in the
nature of time that is does not repeat itself. That is; what is wanted
is a unique number rather than a random one, and each item in a sequence
of increasing integer values is unique within that sequnce.
It cannot be guaranteed that each time will be unique. JavaScript uses
the system clock. Granted, the odds that a user will change the time
and a second request goes out with the same millisecond timestamp is
very small. Perhaps 1 in a trillion? ;)
That is a flaw in the approach -
not a different method to accomplish the same goal.


I guess I'll admit there was a flaw.


Yes it is. At lest in part because the proposal that the OP should "make
sure" that no two random numbers be the same is considerably more
troublesome than an available alternative.


I agree that it would be. But, again, the odds are remote enough to
preclude the need to do so.
And that is that I didn't write
all the javascript for the original poster.
I guess I'm more of a teach-a-man-to-fish sort
of guy versus a give-a-man-a-fish guy.


"Fishing" in an HTTP context would be better mastered with an
understanding of HTTP, and specifically the way in which various HTTP
headers can be configured to discourage client-side caching of various
resources (and possibly the different ways in which POST and GET
requests are handled with regard to caching). With the correct header
configuration it is possible that the URL hack would be unnecessary,
else you would see such "random numbers" on the end of every URL on
every dynamic site.


We agree again! But as this is a JavaScript Usenet group, the
workaround(hack ) suggested involved JavaScript. But just so you know
that I'm not being stubbornly argumentative, I'll agree that the
millisecond method is superior assuming no user clock adjustments. The
random number method would be superior for requests made within 50
milliseconds of each other.

Now that I think about it, both methods should be used simultaneously.
Append the random number after the millisecond timestamp and then you
have a workaround that avoids the simultaneous request problem and the
user clock adjustment problem. Genious!

Oct 13 '05 #11
JRS: In article <di************ *******@news.de mon.co.uk>, dated
Thu, 13 Oct 2005 17:57:42, seen in news:comp.lang. javascript,
Richard Cornford <Ri*****@litote s.demon.co.uk> posted :

That is why using the millisecond time in this context has been
proposed, as each time will be unique (at least so long as no two times
are requested within about 60 milliseconds, at most) and it is in the
nature of time that is does not repeat itself.


For the present purpose, that, if correctly interpreted, will
do.

However, the current time has to be in a form not affected by
Summer Time (a civil hour in Autumn is repeated, in many
places); and, for travellers, by change in location : so UTC
should be used, and +new Date() will give that.

Also, any system in which a drifty clock is corrected by
reference to a time source is liable to have repeated times.

Real Greenwich Mean Time and Real UTC are monotonic, increasing
by close to / exactly one second per second; buy, when it really
matters, one should allow for a computer's estimate of time to
be non-monotonic.

--
© John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v4.00 MIME. ©
Web <URL:http://www.merlyn.demo n.co.uk/> - w. FAQish topics, links, acronyms
PAS EXE etc : <URL:http://www.merlyn.demo n.co.uk/programs/> - see 00index.htm
Dates - miscdate.htm moredate.htm js-dates.htm pas-time.htm critdate.htm etc.
Oct 14 '05 #12

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

Similar topics

4
3262
by: Irene | last post by:
Hi, I have an asp page that allows a user to search for info in a DB and add info to a DB. The search uses "ADODB.Connection" objects in the page, but the add will use a call to an isapi dll via the "Microsoft.XMLHTTP" object. The results of the isapi dll will be displayed to the user without refreshing the asp page. I have a code snippet below for the isapi call. WHat is happening is that the xmlhttp.responseText from the snippet...
3
1993
by: kajol | last post by:
Hi everyone I am trying to get the content of any webpage (URL) using XMLHTTP, and it is working fine for me, but suddenly I have got a URL "http://www.bizrate.com/" which is causing a system error and the error is System.Runtime.InteropServices.COMException(0xC00CE56E): System error:- 1072896658
3
3096
by: Mark | last post by:
Hi all i was just wondering if you help. I have to send a cgi request to a company using xmlhttp request. They reply back with a line of info but when you view the internet explorer source code you see the XML format. I was just wonder if anyone could help me save the xml format to a xml file. I woul like to show you my code but there is to much confidential information about the company.
5
449
by: jim.frantzen | last post by:
You have an active XMLHTTP request on the main page (localhost/App1/index.aspx) The XMLHTTP request takes about 60 seconds to receive a response back from localhost/App1/getxml.aspx. You have an IFRAME on this main page. When you set the iframe's src to google.com, it works fine. When you set the iframe's src to localhost/App1/test.htm, it works fine. When you set the iframe's src to
9
2386
by: balakrishnan.dinesh | last post by:
hi friends, Exactly what i want to know is, In my product we are using xmlhttp request to retrive some data from the server, And Im using IE browser, its working fine in IE. Now i want to work with netscape,I dont know how to pass the xmlhttp request in Netscape. i got some code like below for netscape for xmlhttp var oXML=new XMLHttpRequest();
4
11440
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 XMLHTTP object. However, when the page requested through the XML object makes a <%Response.Redirect()%> call, a new session is created each time. Is this a flaw in the XMLHTTP Object? How can I force the session to remain the same after a...
0
2754
by: SushiSean | last post by:
When executing the xmlhttp.send function to request shipper for available shipments (I send xml as string and receive result xml): XMLHTTP xmlhttp = new XMLHTTP(); xmlhttp.open("POST", "https://gateway.fedex.com:443/GatewayDC", false, "", ""); xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xmlhttp.send(strXML);
1
1587
by: tsangkinyip | last post by:
Hi there, I have a diary page where I would like to fade in the text content and an image when a user tries to click on a date in the calendar. Things work fine offline, but when I upload the files to the server I've found that the server is much slower than I've thought and the xmlhttp request has been executed before getting the image and body objects, which leads to a javascript error. May I ask what I can do to solve the problem?...
4
8286
by: sirjohnofthewest | last post by:
If I possessed the power to sway the mind of every user in the world to delete all forms of Internet Explorer I would die a happy man. Hi guys, I frequently visit this site to get answers to my problems and this one is really getting to me... I have a page that allows you to Browse Authors. There are three drop down boxes that auto-populate via AJAX. I have a file which it calls and returns the dynamically built XML file in the boxes...
3
19062
by: JMcCrillis | last post by:
I've implemented a FileUpload servlet using AJAX and JS. It appears to be working well but for one issue. I used XMLHTTP so I could intercept the response in Javascript and write it out to a field on my webpage. I get back that my readyState is 4 and my status is 200 and status text is "OK", but my responseText is always empty. Both on FireFox and IE7, so it must be something I'm doing (wrong). I've also set up an IFRAME to redirect the...
0
9716
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9595
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10604
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10359
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9177
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7643
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5536
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5675
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3005
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.