**My goal:**

1. User clicks button
2. Button begins myTimeConsumingProcess()
3. A TextBox in the same page updates once per second and adds a ".", until the process is complete.

**What I have (this works, but it's not quite what I want):**

1. User clicks button Button that begins myTimeConsumingProcess()
2. A new Thread executes myTimeConsumingProcess()
3. User is redirected to a "Processing" page
4. Using a boolean Session variable, this page refreshes endlessly until the thread left in the previous page switches the Session variable to false.

**The code so far:**

**DatabaseChecker.aspx.cs**

```
protected void btnStartProcess_Click(object sender, EventArgs e)
{
    Session["Running"] = true;
    Session["TextBoxContent"] = "Beginning myTimeConsumingProcess()...";
    Thread thread = new Thread(new ThreadStart(MyTimeConsumingProcess));
    thread.Start();
    Response.Redirect("Processing.aspx");
}

private void myTimeConsumingProcess()
{
    //do stuff!
    Session["TextBoxContent"] += "SUCCESS!"
    Session["Running"] = false;
}

```

---

**Processing.aspx**

Refresh the page every second:

```
<meta http-equiv="refresh" content="1" /> 

```

**Processing.aspx.cs**

Stay on this page, refreshing every 1 second, until the thread (left in DatabaseChecker.aspx.cs) turns the Session variable "Running" to false.

```
protected void Page_Load(object sender, EventArgs e)
{
    TextBox1.Text = Session["TextBoxContent"].ToString();
    Session["TextBoxContent"] += ".";

    if ((bool)Session["Running"] == false)
    {
        Response.Redirect("DatabaseChecker.aspx");
    }
}

```

**What I want that I can't figure out:**

If possible, I'd like to avoid redirecting to another page, and instead just update the TextBox in the page where the button was clicked. I tried just redirecting to the same page using a QueryString to indicate where I am in the process. However, this doesn't work --- the code to redirect to the same page IS reached, and the text IS updated, however nothing appears to happen UNTIL the process is complete (which defeats the purpose of the thread).

I have tried every alternative I can think of, including `UpdatePanel`, `Timer` `PageAsyncTask` controls, and virtually every combination I could think of by using those controls in combination with Threads, and with the .aspx page's Async property set to true.