'True' Asynch streams using IE

Last post 10-12-2005 9:16 AM by ZackThom. 1 replies.

Sort Posts:

  • 'True' Asynch streams using IE

    10-03-2005, 9:04 AM
    • Member
      10 point Member
    • ZackThom
    • Member since 10-03-2005, 8:29 AM
    • Posts 2
    I created a page in ASP.Net that does the following:
    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#)

    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!

  • Re: 'True' Asynch streams using IE

    10-12-2005, 9:16 AM
    • Member
      10 point Member
    • ZackThom
    • Member since 10-03-2005, 8:29 AM
    • Posts 2

    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!

Page 1 of 1 (2 items)