A familiar question in the ASP.NET world is: "How do I show the progress of a long-running background operation?"
ASP.NET AJAX has given us new tools to answer this question. It's easy to drop an UpdatePanel and a Timer inside a web form, and partially update the
page when the Timer control posts back. There are still some fundamentals to remember when taking this approach, however.
For example:
protected
void Button1_Click(object sender, EventArgs e){ HeavyDutyWorker
worker = new
HeavyDutyWorker
(); worker.ProgressNotification += new
ProgressEventHandler
(worker_ProgressNotification); worker.DoWork();}void worker_ProgressNotification(object
sender, ProgressEventArgs args){ Session
[ProgressKey] = args.PercentComplete; }protected
void Timer1_Tick(object sender, EventArgs e){ Label1.Text = String.Format("Percent Complete = {0}",
Session[ProgressKey]);}
The button click event handler creates an object...