Page not rendering until BackgroundWorker.RunWorkerAsync completes

Posted by brainimus on Stack Overflow See other posts from Stack Overflow or by brainimus
Published on 2010-06-08T18:30:49Z Indexed on 2010/06/08 18:42 UTC
Read the original article Hit count: 230

Filed under:
|
|

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();

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET