473,383 Members | 1,876 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,383 software developers and data experts.

STUMPED: IFRAME link won't load until XMLHTTP finishes!?

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
localhost/DifferentApplication/index.aspx, it works fine.

When you set the iframe's src to localhost/App1/foo.aspx, IT WONT
LOAD...until the XMLHTTP request has finished.

I'm completely at loss here. fyi: foo.aspx.cs --> Response.Write("hi");

It's like IIS is queuing the requests. BUT, I can make concurrent
XMLHTTP requests and they work fine.

Any experts out there know what's happening?

Nov 22 '05 #1
5 2028
Are you using async XMLHTTP ? The following test.aspx page retrieves rss
feed from MSDN with a 2 second delay to simulate the slow XMLHTTP request:

<%@LANGUAGE=C#%>
<%@Import Namespace="System.Xml"%>
<%@Import Namespace="System.IO"%>
<%@Import Namespace="System.Net"%>
<%
Response.Clear();
Response.ContentType = "text/xml";

System.Threading.Thread.Sleep(2000);
WebRequest req = WebRequest.Create("http://msdn.microsoft.com/rss.xml");
Stream stm = req.GetResponse().GetResponseStream();
int max = 64000;
byte[] buffer = new byte[max];
int len = 0;
while ((len = stm.Read(buffer, 0, max)) > 0) {
Response.OutputStream.Write(buffer, 0, len);
}
Response.End();
%>
Then the following page loads an IFrame then later displays the result of
the XMLHTTP request once the readyState goes to 4 = "complete":

<%@LANGUAGE=C#%><%
Response.ContentType="text/html";
%>
<html>
<script language=jscript>
var http;
function LoadRss() {
http = new ActiveXObject("MSXML2.XMLHTTP");
http.open("GET", "rss.aspx", true);
http.onreadystatechange = Complete;
http.send("");
}
function Complete() {
window.status = "readyState=" + http.readyState;
if (http.readyState == 4) {
var doc = http.responseXML;
RSS.innerText = doc.xml;
}
}
</script>
<body onload="LoadRss()">
<iframe src="frame.htm">
</iframe>
<xmp id=RSS></xmp>
</body>
</html>

This shows that the IFrame loads fine before the XMLHTTP request is
finished.
<ji**********@gmail.com> wrote in message
news:11********************@z14g2000cwz.googlegrou ps.com...
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
localhost/DifferentApplication/index.aspx, it works fine.

When you set the iframe's src to localhost/App1/foo.aspx, IT WONT
LOAD...until the XMLHTTP request has finished.

I'm completely at loss here. fyi: foo.aspx.cs --> Response.Write("hi");

It's like IIS is queuing the requests. BUT, I can make concurrent
XMLHTTP requests and they work fine.

Any experts out there know what's happening?

Nov 22 '05 #2
The problem I'm having is when both the URL of the XMLHTTP request and
the IFRAME point to pages in the same ASP.NET application.

So to make your code fit this problem, change the Thread.Sleep to
something like 20 seconds. And also change the source of the iframe to
test.aspx.
Then lastly, have a link in the body of your main page that fires
LoadRSS(), then click a link in the Iframe's test.aspx and you'll see
what I'm talking about. The Iframe's won't load until the RSS feed
completes.

Nov 22 '05 #3
Apparently: "XMLHTTP uses WinInet which supports two concurrent HTTP
connections to a given remote server... "

Which does explain some things. However when only one XMLHTTP is
active, I'm strying trying to figure out why an href doesn't respond
until that active xml request terminates.

humm.

Nov 22 '05 #4
ji**********@gmail.com wrote:
Apparently: "XMLHTTP uses WinInet which supports two concurrent HTTP
connections to a given remote server... "

Which does explain some things. However when only one XMLHTTP is
active, I'm strying trying to figure out why an href doesn't respond
until that active xml request terminates.


That might be the async parameter in the open method.

--
--.
--=<> Dr. Clue (A.K.A. Ian A. Storms) <>=-- C++,HTML/CSS,Javascript,TCP ...
--`
Nov 22 '05 #5
DrGUI at has a response for this problem here:
http://msdn.microsoft.com/library/de...ui10012002.asp

He recommends using the ServerXMLHTTP object for more scalable
applications.
http://support.microsoft.com/default.aspx?scid=kb;[LN];Q290761

Nov 22 '05 #6

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

Similar topics

7
by: Vincent van Beveren | last post by:
Hi everyone I have a JavaScript app that creates an IFRAME through DOM (createElement('IFRAME')) However, that IFRAME does not have any content yet. ...
5
by: Jim Marquardson | last post by:
Hi, I've struggled with this for a while now, so I'm asking for help. I am trying to click on a link in one page, have that link open up in a new window, and set that newly opened window's...
5
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...
5
by: SigRob | last post by:
I have PAGE1 with the link to PAGE2 with iframe. (iframe load several naked html). I want to add directive to the link to point sprcific content of iframe. to make it clear link on PAGE1 ->...
0
by: Aaron Guo | last post by:
i set a iframe 'frame' in the window 'A.aspx'. and use xmlhttp to read info data from server in A.aspx 's onload event,and at the same time i set the 'frame' 's src to load another window in the...
14
by: Harry Keck | last post by:
I have client side code that uses xmlhttp to make an asyncronous call to the server. This call really churns the server and can take a couple of minutes to finish. I have found that while this...
3
by: PCgeek | last post by:
sorry moved this over to javascript forum, didn't mean to post 2x! Hi guys, I'm trying to put the finishing touches on my website and could really use some help on this particular issue. My page...
4
by: eyalrab | last post by:
I am trying to load page into iframe in IE7 and change the page bgColor after the page has loaded. I tried 2 options: 1. Change the iframe.src from the parent to the new URL. 2. Write div...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.