Friday, January 20, 2012

Asynchronous Controller on MVC

The AsyncController class enables you to write asynchronous action methods. Asynchronous action methods can be used for long-running, non-CPU bound requests. This avoids blocking the Web server from performing work while the request is being processed. On MVC, web services must use AsyncController class for long-running calls.

Change the Controller to AsyncController so that it inherits base class of AsyncController.

In the Model folder create a class

Back to the controller add IndexAsync Action, using TPL

And finally return data with the view

No comments:

Post a Comment