Solved

Response.flush not working

Posted on 2004-04-12
4
502 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…

617 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