Please wait page in ASP.NET MVC

前端 未结 5 766
北恋
北恋 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:21

    You can make it in client side. In each step, you set some session variable with the current step. Then, You make another action in your controller say called: "GetProgress" and assign a view and URI for it.

    In the action, you will check this session and return the current progress of your task. In the client side, make a timer (i.e setTimeOut) and you invoke the URI of the later controller action every specific amount of time - 1 second or so. That is it.

提交回复
热议问题