Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to disable Response.Buffer
    text
    copied!<p>this seems so silly - i must be missing something obvious. I have the following code (just as a test):</p> <pre><code>&lt;%@ Page Language="C#" %&gt; &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;script runat="server"&gt; void page_load(object o, EventArgs e) { Response.Write(new string(' ', 255)); Response.Flush(); for (int i = 0; i &lt; 10; i++) { Response.Write(i + "&lt;BR&gt;"); Response.Flush(); System.Threading.Thread.Sleep(500); } } &lt;/script&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head runat="server"&gt; &lt;title&gt;&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;form id="form1" runat="server"&gt; &lt;div&gt; main div &lt;/div&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>when i test this locally (vista x64, cassini), i get the desired output.. 1, then 2, then 3, etc are all sent non-buffered to the browser. when i try this on the dev server (2003, iis6) it just buffers it all and sends it all at once. is there something obvious i'm missing?? I've also tried putting buffer=false at the top but that also doesn't change this behaviour.</p> <p>to further clarify, i've done a test with fiddler to compare two servers. the first server is a local server on the LAN, the second is a public server. fiddler found no discernible difference between the two, except for the host name. the LAN server did not write out the response until the page had finished loading, the public server wrote the response as it happened. i can also confirm this behaviour happens in both firefox and ie.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload