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
onreadystatecha nge 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(objec t sender, System.EventArg s e)
{
Response.ClearC ontent();
Response.Buffer Output = false;
Response.Write( "Output line #1<br/>" + CRLF);
Response.Flush( );
System.Threadin g.Thread.Sleep( 1000);
Response.Write( "Output line #2<br/>" + CRLF);
Response.Flush( );
System.Threadin g.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! 5 1847
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*@discussion s.microsoft.com > wrote in message
news:FB******** *************** ***********@mic rosoft.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 onreadystatecha nge 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(objec t sender, System.EventArg s e) { Response.ClearC ontent(); Response.Buffer Output = false;
Response.Write( "Output line #1<br/>" + CRLF); Response.Flush( ); System.Threadin g.Thread.Sleep( 1000);
Response.Write( "Output line #2<br/>" + CRLF); Response.Flush( ); System.Threadin g.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!
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(doc ument.getElemen tById('foo').va lue);</script>",
HttpUtility.Htm lEncode("myvalu e"));
Response.Flush( );
-- bruce (sqlwork.com)
"Ric" <Ri*@discussion s.microsoft.com > wrote in message
news:FB******** *************** ***********@mic rosoft.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 onreadystatecha nge 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(objec t sender, System.EventArg s e) { Response.ClearC ontent(); Response.Buffer Output = false;
Response.Write( "Output line #1<br/>" + CRLF); Response.Flush( ); System.Threadin g.Thread.Sleep( 1000);
Response.Write( "Output line #2<br/>" + CRLF); Response.Flush( ); System.Threadin g.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!
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
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!)?
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.asp x 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! This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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 forms
Feature Requested:
A user will be entering some data that will trigger an a notification event.
For example I am a research analyst entering a sell recommendation for a
stock. Once that action is preformed a notification should be sent...
|
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, using the same
HTML/JS it always returns no data (xmlhttp.responseText is null).
When I try to get headers using Mozilla or display the http status code
I get some obscure exception in the javascript console that I've given
up on searching for an...
|
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 two problems:
1. It runs TWICE; and
2. While it seems to update the web page controls, the results never
show up on the page.
I am using delegates per a couple of examples I found on MSDN and
elsewhere.
|
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 are longer running so I call
them asynch so that they can all run concurrently. The user base for
the application that I am creating demands the partial response of the
faster calls and a gradual update of their web page info from the
balance of...
|
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 with netscape,I dont know how to pass the xmlhttp
request in Netscape. i got some code like below for netscape for
xmlhttp
var oXML=new XMLHttpRequest();
| |
by: Techno_Dex |
last post by:
What is the correct way to debug a WS which makes it's call Asynch?
|
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
page, it may take up to 3 seconds to redirect. If I decrease the time
to 500 ms, the redirect happens much faster.
So it seems like this asynch task is not really asynch, since the
redirect is waiting for it to complete. Am I misunderstanding...
|
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 the
version of Microsoft's XML parser and that Microsoft.XMLHTTP refers to
the latest installed version.
This makes me wonder why sites like
<http://developer.apple.com/internet/webcontent/xmlhttpreq.htmlopt to
use Msxml2.XMLHTTP, first, and...
|
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 switched the call
to a synch, the client app got the error message and displayed it
nicely to the user.
In this client app. the user does not have to do anything while
waiting for results to come back from the web, so it makes sense to
call the...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |