How to: Use a Background Worker[
^]
Short version:
Create an event handler for the background worker's DoWork event.
The DoWork event handler is where you run the time-consuming operation on the background thread. Any values that are passed to the background operation are passed in the Argument property of the DoWorkEventArgs object that is passed to the event handler.
To report progress back to the calling process, call the ReportProgress method and pass it a completion percentage from 0 to 100. Calling the ReportProgress method raises the ProgressChanged event, which you handle separately.
There is also this:
How to run Background Tasks in ASP.NET - Scott Hanselman[
^]
to save you some work of adapting it to the web.