Asynchronous Child Actions Still not Supported in .NET 4.5.1
2013-12-27
We have updated our project to .NET 4.5.1, but we see asynchronous child actions still not supported: When we tried to use ChildAction, we got the following error message:
Server Error in '/' Application.
HttpServerUtility.Execute blocked while waiting for an asynchronous operation to complete. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
__
__
Exception Details: System.InvalidOperationException: HttpServerUtility.Execute blocked while waiting for an asynchronous operation to complete.
Source Error:
…
The sample:
Controller:
public class HomeController : Controller
{
public ActionResult Index()
{
return View();
}
[ChildActionOnly]
public async Task<ActionResult> ChildV()
{
await Task.Delay(2000);
return Content("ChildView");
}
}
ChildView:
@{
ViewBag.Title = "Index";
}
<h2>Index</h2>
@Html.Action("ChildV")
Please read more detail from here.