0

I have used TPL to do long running process like generating 1,00,000 PDF in my asp.net application. Codes is like bellow:

private Task<ErrorList> GeneratePDF()
{
    return Task.Factory.StartNew(

        --pdf generation goes here....
    )
}

Can anybody please help me to do following action:

  1. I want to intimate UI how many PDF has been generated till now.
  2. Once process is completed i want to show one popup page with all details of PDF generation. I could not find a way to write callback....
svick
  • 236,525
  • 50
  • 385
  • 514
Paul
  • 457
  • 2
  • 11
  • 26

1 Answers1

0

I think you are best off using an architecture that polls your web page/service for the progress and status.
How To: Submit and Poll for Long-Running Tasks is one starting point.

Here's another: Asynchronous processing in ASP.Net MVC with Ajax progress bar

For TPL related callback/progress reporting, see: Reporting Progress from Async Tasks

Magnus Johansson
  • 28,010
  • 19
  • 106
  • 164