Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Response.Flush problem

Reply
Thread Tools

Response.Flush problem

 
 
Mantas Miliukas
Guest
Posts: n/a
 
      03-14-2005
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.

---
m2


 
Reply With Quote
 
 
 
 
Patrice
Guest
Posts: n/a
 
      03-14-2005
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
--

"Mantas Miliukas" <(E-Mail Removed)> a écrit dans le message de
news:(E-Mail Removed)...
> 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.
>
> ---
> m2
>
>



 
Reply With Quote
 
 
 
 
Mantas Miliukas
Guest
Posts: n/a
 
      03-14-2005
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" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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
> --
>
> "Mantas Miliukas" <(E-Mail Removed)> a écrit dans le message de
> news:(E-Mail Removed)...
>> 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.
>>
>> ---
>> m2
>>
>>

>
>



 
Reply With Quote
 
Jeff @ Dart
Guest
Posts: n/a
 
      03-14-2005
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?

 
Reply With Quote
 
Mantas Miliukas
Guest
Posts: n/a
 
      03-15-2005
Ok, I will try, thanks for Your suggestions.

"Jeff @ Dart" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> 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?
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem problem problem :( Need Help Mike ASP General 2 05-11-2004 08:36 AM



Advertisments