Solved

Response.flush not working

Posted on 2004-04-12
4
467 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
ID: 10806107
0
 
LVL 5

Accepted Solution

by:
AdrianJMartin earned 500 total points
ID: 10811768
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

862 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

23 Experts available now in Live!

Get 1:1 Help Now