ASP.NET 4.5 has support for Asynchronous pages for web forms and MVC4 it seems. Is this possible in WebMatrix as well? Node.js was the spark for this I imagine and I’ve done some work in node.js recently and would like to follow a similar pattern of freeing up threads where possible.
As a work around, I suppose it would be possible to create an ASHX handler that utilized razor helpers using task and await etc. but its not so convenient. At the very least, I could serve ASHX handlers for AJAX requests this way. If you want to show some examples of that, it could be helpful as my apps in webmatrix are heavy in ASHX handlers with JSON.
Right now, WebMatrix lacks editor support for the “async” and “await” keywords, which will unfortunately block this scenario in that tool. I’ve filed a bug against that product, and hopefully it will be addressed at some future date.
You can, however, use Visual Studio Express for Web for this scenario. You should be able to get full editor and compiler support for asychronous coding in Razor-syntax web sites using that environment.