Please wait page in ASP.NET MVC

前端 未结 5 765
北恋
北恋 2021-02-04 20:26

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 Respo

5条回答
  •  执念已碎
    2021-02-04 21:29

    There are two basic ways:

    1. Poll a server page that returns the status, then once the operation is done, redirects to a results page. MVC is nothing to do with this way, you'd need to use a server variable to store objects/status - this is a way that's more relevant to a standard Asp.NET application as you're (presumably) using session variables etc. anyway.

    2. AJAX call from the client to a webservice on the server. Asp.NET MVC is going to be rolling the jQuery framework in, so use that for the client call and event handling for the response. This would be more in the spirit of MVC which doesn't/shouldn't use session state etc.

提交回复
热议问题