Page not rendering until BackgroundWorker.RunWorkerAsync completes
- by brainimus
I have an aspx page that on a button click creates a BackgroundWorker and then calls the RunWorkerAsync method. In my aspx file I have set Async='true' but when I run the application and click the button it appears as though the page waits to refresh until the processing of the BackgroundWorker is done. How do I get control to return to the page (and have the page refresh) after the BackgroundWorker is created and started?
BackgroundWorker worker = new BackgroundWorker();
worker.DoWork += RunJob;
worker.RunWorkerCompleted += JobCompleted;
worker.RunWorkerAsync();