Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4607354
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T00:41:29+00:00 2026-05-22T00:41:29+00:00

protected void Page_Load(object sender, EventArgs e) { Response.Buffer = false; while (true) { Response.Write(Delimiter

  • 0
protected void Page_Load(object sender, EventArgs e)
{
    Response.Buffer = false;

    while (true)
    {
        Response.Write(Delimiter + DateTime.Now.ToString("HH:mm:ss.FFF"));
        Response.Flush();

        // Suspend the thread for 1/2 a second
        System.Threading.Thread.Sleep(500);
    }

    // Yes I know we'll never get here, it's just hard not to include it!
    Response.End();
}

When Response.Flush() is executed, the new webpage is sent to the client
The while block will run forever on the server
When the new maeeage reaches the client, there is a refresh for the new data
How is it posible to continue the same place. Shouldn’t there be a new Page object created?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T00:41:30+00:00Added an answer on May 22, 2026 at 12:41 am

    There are a few problems with what you’ve described…

    1) You’ve described mis-matching client and server code. The server code there only works with a single AJAX request that hangs around forever, and gets notified on the client but doesn’t start a new request. In your comments, however, you’ve described a client that does start a new request. Those 2 concepts won’t work together.

    2) Elaborating on point 1, the request never ending means that most browsers will never see it. “Typical” AJAX requests won’t change state until the entire contents arrive, so that request will just hang forever. You’ll have to end the request, or use an XHR request that changes state as each chunk is flushed from the server, which only would be viable in certain browsers.

    3) Even if 1) worked, proxies, etc, would kill the request eventually. They don’t like requests sitting around forever.

    4) That’s a blocking synchronous request, which’ll eat server resources like crazy. That won’t get beyond a the threadpool limit before it fails catastrophically.

    So yea, the example you’ve given here doesn’t make sense :).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { Response.Cache.SetCacheability(HttpCacheability.NoCache ); Response.Cache.SetAllowResponseInBrowserHistory(false); }
Shouldn't PostBack be checked before Session protected void Page_Load(object sender, EventArgs e) { if
My code: protected void Page_Load(object sender, EventArgs e) { String userHost = Request.UserHostName }
This works just fine: protected void txtTest_Load(object sender, EventArgs e) { if (sender is
Consider the following code: Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
I am sorting a GridView bind to a ananymous type. protected void GridView1_Sorting(object sender,
typedef void (FunctionSet::* Function)(); class MyFunctionSet : public FunctionSet { protected: void addFunctions() {
In my code behind I wire up my events like so: protected override void
class MyBase { protected object PropertyOfBase { get; set; } } class MyType :
Should you ever use protected member variables? What are the the advantages and what

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.