R – Please wait page in ASP.NET MVC

asp.net-mvcwebforms

A page executes a number of tasks and takes a long time to process. We want to give the user feedback as each task is completed.

In ASP.NET webforms we used Response.Flush()

What way would you a approach this in ASP.NET MVC?

Best Answer

You can still use Response.Write() and Response.Flush() for whatever status you want to send down the wire. Or if you have your progress thingy in a user-control, you could do something like:

this.PartialView("Progress").ExecuteResult(this.ControllerContext);
this.Response.Flush();

from your controller while doing your lengthy operation in the controller's action method.

It's up to you to choose this or the client-side approach as mentioned in the comments here, just wanted to point out that server-side is still possible.