mcamara
mcamara

Reputation: 753

Load Page and Execute Async Method

I have to load page where in this page exist an text informing the user that your request is loading. But in parallel in code behind need to execute an async method and when this method is end my page have to redirect to other page.

Somebody help me to solve this question?

BEst Regards.

Upvotes: 0

Views: 911

Answers (1)

Alain
Alain

Reputation: 27250

Follow this microsoft example on creating a Background worker thread in ASP.NET.

Sometimes we do an operation which needs long time to complete. It will stop the response and the page is blank until the operation finished. In this case, We want the operation to run in the background, and in the page, we want to display the progress of the running operation. Therefore, the user can know the operation is running and can know the progress.

On the other hand, we want to schedule some operations (send email/report ect.). We want the operations can be run at the specific time.

This project creates a class named "BackgroundWorker" to achieve these goals. It creates a page named "Default.aspx" to run the long time operation. And it creates a Background Worker to do the schedule when application starts up, then it uses "GlobalBackgroundWorker.aspx" page to check the progress.

Upvotes: 1

Related Questions