views:

118

answers:

1

Microsoft has included the AsyncController to the latest beta version of the Mvc framework. I'm currently working on a project where we have to use Asp.net MVC v1.0. There is a long-running process in the application (large file upload, some processing and then saving a large amount of data in the database). I have found some tutorials about how to use the new asynchronous controller, but not sure if I can (have to) use the one included in the Mvc Futures library (for v1.0) in the same way, or are there any differences?

Also, are there any alternative ways of handling such long operations in Asp.Mvc?

Thanks.

Edit

Beside @mkedobbs' link below, I've found these ones also helpful:

http://blog.codeville.net/2008/04/05/improve-scalability-in-aspnet-mvc-using-asynchronous-requests/

http://weblogs.asp.net/seanmcalinden/archive/2009/11/15/asynchronous-processing-in-asp-net-mvc-with-ajax-progress-bar.aspx

+1  A: 

This blog post has step-by-step instructions on what you would need to do to use the MVC Futures Async Controller in your MVC 1.0 project.

As far as an alternative is concerned, you could create a javascript polling mechanism... basically have the controller kick off work on another thread and return some sort of job identifier to the browser and have the browser use javascript to poll for a result from another action based on that identifier. I used this type of technique when waiting for YouTube to process an uploaded video and it worked out well.

mkedobbs
I've also used the polling method before, but I was looking for something that requires less code - at least on the client side. Thanks for the link.