开发者

ASP.NET MVC AsyncController continue browsing while waiting

开发者 https://www.devze.com 2023-03-31 12:45 出处:网络
I want to use jQuery ajaxForm to post data to an AsyncController to fire off some task. I want the user to be able to continue browsing to other pages while this task completes. I then want to display

I want to use jQuery ajaxForm to post data to an AsyncController to fire off some task. I want the user to be able to continue browsing to other pages while this task completes. I then want to display a status message using something like jGrowl once the task has completed.

Does anyone think this is possible?

First issue, does the callback action xxxCompleted fire when leaving the page that called xxxAsync?

Second issue, how would you retrieve the JsonResult returned from xxxCompleted to display in the UI (via j开发者_运维知识库Growl for example)?


Yes this is possible assuming "browsing other pages" is obviously in the context of your own site. You can do the "traditional" poll of the server via ajax or take a look at Comet or the new SignalR just released.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号