473,378 Members | 1,417 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Response.Flush problem

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
Nov 19 '05 #1
4 5833
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" <ma****@raktas.net> a écrit dans le message de
news:e0*************@TK2MSFTNGP14.phx.gbl...
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

Nov 19 '05 #2
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" <no****@nowhere.com> wrote in message
news:%2***************@TK2MSFTNGP15.phx.gbl...
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" <ma****@raktas.net> a écrit dans le message de
news:e0*************@TK2MSFTNGP14.phx.gbl...
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


Nov 19 '05 #3
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?

Nov 19 '05 #4
Ok, I will try, thanks for Your suggestions.

"Jeff @ Dart" <th********@gmail.com> wrote in message
news:11**********************@l41g2000cwc.googlegr 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?

Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Copa | last post by:
Hello, I am testing buffering an asp page and Flushing information out to the browser, hence i wrote the code in an asp page that follows this Message Post. The loops are suppose to simulate...
7
by: Jon Spivey | last post by:
Experimenting with response.flush() but can't seem to get it to work. This code <% response.write "<p>started</p>" response.flush() for i = 1 to 10000000 i = i +1 next response.write...
3
by: Gary | last post by:
I am having a strange problem that I cannot solve. I have an asp page that I use for a user to login and gain access to other pages. When the user logs in I set a couple of session variables like...
9
by: Dominic Godin | last post by:
Hi, I have an asp page that does a lot of processing and reports it's finished by printing the word "Success". For example: <% SomeFunction(SomeVar) SomeFunction(SomeVar1) ...
3
by: Jason | last post by:
I am using response.flush in order to display "Please wait" message. The problem is that it takes about 15 to 20 seconds for the message to appear. How can I make this appear as soon as the user...
5
by: Luiz Vianna | last post by:
Guys, I need to send some info to my client while I'm processing some stuff. The flow will be something like : -process -response -process -response .... I imagine to use response.flush...
0
by: jose.mendez22 | last post by:
I'm trying to fire a pop-up window before I execute a lengthy stored procedure so I may utilize this window as a status window on number of records executed. After my response.write statements...
12
by: Jim Rodgers | last post by:
I have a big asp file that has an error under certain conditions -- totally repeatable. However, it only fails when I set response.buffer = True at the top. WHen I set it False in order to debug...
3
by: MJP | last post by:
I have a button which kicks off the generation of a report after which the file will be downloaded. The report generation can take a long time, so client side onclick event of the button also...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.