I'm new to ASP.net and I am facing a problem with asynchronous tasks.
Here is what I would like to do.
Let's say I have a web page named WebPage1 with a button Button1.
protected void Button1_Click(object sender, EventArgs e)
{
Button1.Text = "Working....";
System.Threading.Thread.Sleep(20000);
Button1.Text = "Finish !";
}
I would like to be able to switch to WebPage2 without losing the task I started with Button 1. So when I go back to WebPage1 after 20seconds, I should be able to read "Finish !" on the button.
Is it possible? I stress that I have to do this with .net 4.0
I have alread been looking at
- Task Class
- PageAsyncTask Class
- IAsyncResult Interface
but I can't find a way to resolve my problem
Thanks in advance !