472,976 Members | 1,534 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

REAL asynch XmlHttp with IE

Ric
I created a page in ASP.Net (with no buffering) that does the following:
Output line #1
FLUSH
{wait 1 second}

Output line #2
{wait 1 second}

Output line #3
FLUSH
......etc

If I browse to the page, you can see that the response comes back as a
STREAM, as it happens. (Note you can only see this the SECOND time the page
is loaded in IE)

When I use XmlHttp in IE, the response only comes back when the WHOLE page
is done. However, in other browsers, it works as expected. The
onreadystatechange raises the event in my JS callback function when the
document is complete, but FireFox raises it for each FLUSH, which is the
effect I need. I would like to know if anyone else can make IE XmlHttp object
do the stream.

Example code: (C#)

private void Page_Load(object sender, System.EventArgs e)
{
Response.ClearContent();
Response.BufferOutput = false;

Response.Write("Output line #1<br/>" + CRLF);
Response.Flush();
System.Threading.Thread.Sleep(1000);

Response.Write("Output line #2<br/>" + CRLF);
Response.Flush();
System.Threading.Thread.Sleep(1000);

//etc..
Techniques I have tried:
1) Asynch Http Module - the module worked, but the client side still did not
2) JavaScript work arounds:
a) Polling
b) Remote Scripting (this works, but must use a GET, and so is not as
secure)
c) Timeouts (too many requests)
3) HTA - also works, but only on IE

Any help would be appreciated!
Nov 19 '05 #1
5 1799
The problem in IE is that IE is being as strict as XML is. The document is
not well-formed until all opening tags are closed. This is likely to cause
problems with other browsers as well. If not now, perhaps later.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Ambiguity has a certain quality to it.

"Ric" <Ri*@discussions.microsoft.com> wrote in message
news:FB**********************************@microsof t.com...
I created a page in ASP.Net (with no buffering) that does the following:
Output line #1
FLUSH
{wait 1 second}

Output line #2
{wait 1 second}

Output line #3
FLUSH
.....etc

If I browse to the page, you can see that the response comes back as a
STREAM, as it happens. (Note you can only see this the SECOND time the
page
is loaded in IE)

When I use XmlHttp in IE, the response only comes back when the WHOLE page
is done. However, in other browsers, it works as expected. The
onreadystatechange raises the event in my JS callback function when the
document is complete, but FireFox raises it for each FLUSH, which is the
effect I need. I would like to know if anyone else can make IE XmlHttp
object
do the stream.

Example code: (C#)

private void Page_Load(object sender, System.EventArgs e)
{
Response.ClearContent();
Response.BufferOutput = false;

Response.Write("Output line #1<br/>" + CRLF);
Response.Flush();
System.Threading.Thread.Sleep(1000);

Response.Write("Output line #2<br/>" + CRLF);
Response.Flush();
System.Threading.Thread.Sleep(1000);

//etc..
Techniques I have tried:
1) Asynch Http Module - the module worked, but the client side still did
not
2) JavaScript work arounds:
a) Polling
b) Remote Scripting (this works, but must use a GET, and so is not as
secure)
c) Timeouts (too many requests)
3) HTA - also works, but only on IE

Any help would be appreciated!

Nov 19 '05 #2
while Mozilla/Firefox/safari copied the XMLHTTP object, they coded for use
in the browser (even adding SOAP support), while the microsoft version is
actually part the msxml kit. it doesn't support async (the ServerXmlHTTP
does, but can not be used by the browser).

to do what you want, i'd poll with xmlhttp (no sleep, each one is its own
request) or use the iframe pattern. using document.write and an iframe you
can pass as mush data to the server as you want. the server can flush code
like

Response.Write(string.Format(@"<input type=hidden id=foo" value="{0}">
<script>parent.processData(document.getElementById ('foo').value);</script>",
HttpUtility.HtmlEncode("myvalue"));
Response.Flush();
-- bruce (sqlwork.com)

"Ric" <Ri*@discussions.microsoft.com> wrote in message
news:FB**********************************@microsof t.com...
I created a page in ASP.Net (with no buffering) that does the following:
Output line #1
FLUSH
{wait 1 second}

Output line #2
{wait 1 second}

Output line #3
FLUSH
.....etc

If I browse to the page, you can see that the response comes back as a
STREAM, as it happens. (Note you can only see this the SECOND time the
page
is loaded in IE)

When I use XmlHttp in IE, the response only comes back when the WHOLE page
is done. However, in other browsers, it works as expected. The
onreadystatechange raises the event in my JS callback function when the
document is complete, but FireFox raises it for each FLUSH, which is the
effect I need. I would like to know if anyone else can make IE XmlHttp
object
do the stream.

Example code: (C#)

private void Page_Load(object sender, System.EventArgs e)
{
Response.ClearContent();
Response.BufferOutput = false;

Response.Write("Output line #1<br/>" + CRLF);
Response.Flush();
System.Threading.Thread.Sleep(1000);

Response.Write("Output line #2<br/>" + CRLF);
Response.Flush();
System.Threading.Thread.Sleep(1000);

//etc..
Techniques I have tried:
1) Asynch Http Module - the module worked, but the client side still did
not
2) JavaScript work arounds:
a) Polling
b) Remote Scripting (this works, but must use a GET, and so is not as
secure)
c) Timeouts (too many requests)
3) HTA - also works, but only on IE

Any help would be appreciated!

Nov 19 '05 #3
Ric
Kevin,

I am sorry, but I do not think this has anything to do with well formed Xml.
The data sent back is actually valid XhtML.

Also, I am using the msXmlHttp .ResponseBody property not .Xml

Than you
Nov 19 '05 #4
Ric
Bruce,

The msXmlHttp does return for each method: when I set the mthod, .Open the
connection, and receive the data. So it is _kind_of_ ansyncronous in that my
other javaScript events may respond.

I hoping there may be a property that I maight be able to set or maybe use
the .ResponseXml to get the data as it comes out.

I am afraid you may be correct: while I may be able to code around the issue
with timeouts or remote scripting, msXmlHttp object does not give me the
response stream as it is sent - it waits until the whole document is done.

Is is unfortunate that Microsoft inveted this capability, but has not
implemented this obvious use, but Mozilla has. Do you know of any existing
remote scripting that works like the XmlHttp object (not frames!)?

Nov 19 '05 #5
Ric
It looks like this problem is with Internet Explorer and not just XmlHttp
object
I put an example up on http://www.ECMASCRIPT.net/
If you click on the link in Firefox you get the document as it streams.
If you click on the link in IE, it waits until the whole document is done
the first time. If you hit refresh on /TimedOutput.aspx you get the same as
firefox.

The button simply uses the Xmlhttp object to request the same page and
display the result as it get it. It works well in fireFox, but not IE

Is this a header problem? Or did I set up IIS wrong? Can I write my Asp.Net
Page any way to fix this?

Any help would be appreciated!
Nov 19 '05 #6

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

Similar topics

10
by: MasterBlaster | last post by:
We are in the initial stages of design analysis and I'm trying to come up with some ideas on how to handle the feature our users are requiring from the new application. We are using VB.NET/window...
9
by: fochie | last post by:
Greetings, I'm having a problem when I try to GET a file from my server via xmlhttp when using Mozilla. With IE I can get any type of file fine, get/display headers fine, etc. With Mozilla,...
11
by: Glen Wolinsky | last post by:
This is my first attempt as asynchronous processing. I have created a small test app as proof of concept, but I am having one proglem. In the example (code listed below), my callback routine has...
2
by: ghost | last post by:
As the Subject indicates I have written a web page that makes use of several web service calls. Some of the web service calls are very fast so they called synchronously. Some web service calls...
9
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...
2
by: Techno_Dex | last post by:
What is the correct way to debug a WS which makes it's call Asynch?
4
by: EM_J | last post by:
I am implementing this interface in one of my pages. The RaiseCallbackEvent method runs a task for about 3 seconds. I've noticed when I am on that page and click a tab to navigate to another...
13
by: yawnmoth | last post by:
<http://www.quirksmode.org/book/printable/xmlhttp.txtshows two alternatives to Microsoft.XMLHTTP - Msxml2.XMLHTTP and Msxml3.XMLHTTP. If my understanding is correct, the different numbers refer to...
0
by: Patino | last post by:
I have a particular WS consumer application (Windows app) that was not able to read an error from the WS app because it was calling a method asynch. The client app just hangs there. But once I...
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

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.