Response.AddHeader("Content-type: multipart/x-mixed-replace;boundary=MyBoundary")
>Then send your data using Response.write:
>Do While lLinked
> If lNewData() Then
> cNewData = GetRefreshData()
> Response.Write(cNewData)
> Response.Write("--MyBoundary")
> End If
>Loop
>
>Response.Write("--MyBoundary--")
I was really curious about this, so Itried to get it to work, and couldn't. I tried explicitly setting a content-type using AddHeader, and by setting Response.ContentType property. I created a simple page with text like:
<%
Response.Buffer = False
Response.ContentType = "multipart/x-mixed-replace;boundary=MyBoundary"
Set oTest = Server.CreateObject("TestServer.Test")
Response.Write oTest.Delaysay("Say This")
Response.Write("--MyBoundary")
Response.Write oTest.Delaysay("And then say This")
Response.Write("--MyBoundary")
Response.Write oTest.Delaysay("Finally, say This")
Response.Write("--MyBoundary--")
%>
DelaySay is a simple method that uses the Sleep API call to delay the process for 5 seconds, and then return the passed in text.
the first line in the script is to ensure that output is sent as it is created instead of buffered until script finishes executing.
The result of this page is as if there were no special content type at all- the results "stream", but subsequent parts of the response to not replace the previous contents as they should; they just pile on top of each other like a regular ASP would, and the "--MyBoundary" shows like regular output.
Not sure if it was something I was doing wrong, or that IE5 doesn't care about this content type...Erik Moore
Clientelligence