views:

1931

answers:

5

I'm learning ASP.NET MVC Framework, From some articles like this, it seems that MvcHandler has only Execute() implemented, there is no asynchronous API implemented. Actually, I don't think Controller has asynchronous API either.

So, ASP.NET MVC doesn't support asynchronous programming? this could be a big hurdle to scalability if the web page needs I/O operation.

+5  A: 

At the moment, async support is not built into MVC. It's on the feature list, but no guarantees as to exactly when it might be released (and in what form).

Brad Wilson
As an update: ASP.NET MVC 2 now has Asnyc Controller support. Here's the documentation http://msdn.microsoft.com/en-us/library/ee728598(VS.100,printer).aspx
Pita.O
+6  A: 

After some googling, I found this terrific blog about how to DIY asynchronous ASP.NET MVC. The implementation looks easy and straightforward. I am wondering why ASP.NET MVC team doesn't have this feature at the first time.

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

Morgan Cheng
There's a cut line for features, and inevitably a feature somebody wanted ends up below the cut line. There are tons of "easy and straightforward" things that won't get into v1 because time is not infinite. :)
Brad Wilson
+1  A: 

As Brad mentioned, Microsoft is working on a solution as part of MVC futures. There is also an implementation at: http://code.msdn.microsoft.com/AsyncMvc/Wiki/View.aspx?id=11350

Andrew Csontos
+1  A: 

ASP.NET MVC 2 has now incorporated asnyc controller from the beat release. Check it out.

Pita.O
+2  A: 

MVC 2 supports asynchronous page execution via AsyncController.

http://msdn.microsoft.com/en-us/library/ee728598.aspx

Clay Lenhart