Solved

Response.flush not working

Posted on 2004-04-12
4
463 Views
Last Modified: 2008-02-01
please anybody know why Response.flush is not working? the page does not get refreshed with the new information..

Button1_click(){
          placeholder.Controls.Clear();

               string HTML = "";
               HTML = "<table><tr><td>test</td></tr></table>";
         
               Control objControl = this.Page.ParseControl(HTML);
               this.placeholder.Controls.Add(objControl);
               response.write("test2");

               //Response.Clear();
               Response.Buffer= true;
               Response.Flush();
               this.placeholder.Visible = true;
               Thread.Sleep(15000);
0
Comment
Question by:alain123
4 Comments
 
LVL 1

Author Comment

by:alain123
Comment Utility
0
 
LVL 5

Accepted Solution

by:
AdrianJMartin earned 500 total points
Comment Utility
this works and you see the page 'filling up", it seams the Reponse object does not recognise the setting of Buffer to true until it has flushed the response automatically, I just pushed 300 spaces onto the stream as a test and it works.

            private void Button1_Click(object sender, System.EventArgs e)
            {
                  Response.Buffer= true;

//                  Response.Write( "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789<br>" );
                  Response.Write( "                                                                                                        " );
                  Response.Write( "                                                                                                        " );
                  Response.Write( "                                                                                                        " );

                  Response.Flush();


                  Response.Write("test2");
                  for( int i = 0  ; i < 100 ; i ++ )
                  {
                        
                        Response.Write( string.Format("Message {0}<br>" , i ) ) ;
                        Response.Flush();
                        System.Threading.Thread.Sleep(100);
                  }
            }
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now