Output line #1
{wait 1 second}
Output line #2
{wait 1 second}
Output line #3
....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#)
privatevoid 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!
It looks like this problem is with Internet Explorer and not just XmlHttp object
I put an example up onhttp://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!
No comments:
Post a Comment