I have a method that is quite data intensive and could take minutes. Here is some code:
Data.Common.Documents.Regenerate();
Response.Redirect("~/Members/ManageDocs.aspx");
What is the simplest way to execute this method in a background thread?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Be aware, that if your App Domain gets recycled by the IIS, you’ll lose the thread and everything that goes with it. But if you’re OK with that, you can use TPL (.NET 4):
That’s assuming you don’t have to wait for completion, ’cause that would defeat the point of background processing in this particular case.