Response.Flush problem

M

Mantas Miliukas

Hi,

I have problem when flushing the generated HTML code to the client.
It seems that "Page.Response.Flush()" method doesn't work at all.
See my code below:

protected override void Render(HtmlTextWriter writer)
{
for (int i = 0; i < 100; i ++)
{
writer.Write("...");
writer.Flush();

Page.Response.Flush();
System.Threading.Thread.Sleep(1000);
}
}

The "..." are not sent to the client until the whole asp.net page is
generated.
Have any clues, ideas?

Thanks for your help.
 
P

Patrice

1) Not buffered ?
2) Try to enclose this in a tag. Don't remember this exact point but AFAIK
most browsers render up to the last closing tag...

Patrice
 
M

Mantas Miliukas

Hi,

Thanks for your ideas!

1) I have disabled buffer in aspx page explicitly by
adding "Buffer" property set to "False". I also removed buffering using IIS
management concole.

2) I have tryied this one too, however without a success.

PS. Must note that everything works fine, when the control is moved outside
the HTML body.
See the example below:

<my:LongLastingRendering Runat="Server" .../>
<html>
...[Other html code]
</html>

However the Response.Flush doesn't work when i change the code above into:

<html>
....
<body>
<my:LongLastingRendering Runat="Server" .../>
</body>
</html>

--
m2

Patrice said:
1) Not buffered ?
2) Try to enclose this in a tag. Don't remember this exact point but AFAIK
most browsers render up to the last closing tag...

Patrice
--
 
J

Jeff @ Dart

Try Page.Response.Write instead of Writer.Write? I'm guessing the
HtmlTextWriter doesn't write directly to the response stream, but
buffers internally and writes all the page data at once?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top