473,545 Members | 1,759 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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(HtmlText Writer writer)
{
for (int i = 0; i < 100; i ++)
{
writer.Write(". ..");
writer.Flush();

Page.Response.F lush();
System.Threadin g.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 5842
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******** *****@TK2MSFTNG P14.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(HtmlText Writer writer)
{
for (int i = 0; i < 100; i ++)
{
writer.Write(". ..");
writer.Flush();

Page.Response.F lush();
System.Threadin g.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:LongLasting Rendering Runat="Server" .../>
<html>
...[Other html code]
</html>

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

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

--
m2

"Patrice" <no****@nowhere .com> wrote in message
news:%2******** *******@TK2MSFT NGP15.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******** *****@TK2MSFTNG P14.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(HtmlText Writer writer)
{
for (int i = 0; i < 100; i ++)
{
writer.Write(". ..");
writer.Flush();

Page.Response.F lush();
System.Threadin g.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.W rite 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********@gma il.com> wrote in message
news:11******** **************@ l41g2000cwc.goo glegroups.com.. .
Try Page.Response.W rite 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
2577
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 long search processes with a flush after each search. When i Navigate to the page, redirect to it from another page, or type the URL to this page in...
7
6990
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 "<p>ended</p>" %>
3
2804
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 Session("UserType") = "Sales". Then based on the Session("UserType") I use response.redirect to take the user to a specific page. The logic and...
9
4137
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) SomeFunction(SomeVar3)
3
2484
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 accesses the page. I am using response.buffer = true as well. I have about five include files on the page. <body bgcolor="#FFFFFF"...
5
2492
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 (as I did on ASP) but it does not work. See my test code, after sending 2 lines on response, I'm simulating a processing time before sending other 2...
0
4180
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 which include the javascript I call the flush mehtod, which seems is ignored? However when I mimic the same process using a loop (and no ado object)...
12
7877
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 it, it works every time! I even set it to True, but did a .Flush just before the error, and the error won't happen. It only happens when...
3
10397
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 makes a <span> tag visible which contains a nice message to the user thanking them for their patience. Of course after the report has been generated...
0
7467
marktang
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...
0
7401
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...
0
7656
Oralloy
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. ...
0
7807
jinu1996
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...
1
7419
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7756
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
4944
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...
0
3442
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
703
bsmnconsultancy
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...

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.