Venkat Kumar

Venkat Kumar

  • NA
  • 503
  • 140.1k

Display currently running status of an Action Method

Mar 6 2018 2:42 AM
I have 3 methods in my Run method and Each method is taking 3 minutes to execute and the complete Run Action method takes 9 minutes to complete.
Now What I required is, Instead of loading the Webpage without showing any information in the UI,  I want to display some status message in the View(Index.cshtml) which method is currently executing. 
Example of Status message 
Please wait a moment we are Exporting the database 
Web Job is executing
Web Job Failed, Importing Backup file 
 
//Here is the code
public ActionResult Run(string Name)
{
Exportbackpac(Name);   // Exporting the Database
bool status = ExecuteWebJob(Name); //Running the Azure Webjob
if (status == false)
{
Importbackpac(Name); //Importing Database if Webjob fails
}
return RedirectToAction("Index");
}
Can someone help me how to implement this? 

Answers (1)