Faced with the problem of rendering asynchronous methods. For example, there is a template in which we embed a partial view.
<ul class="nav navbar-nav navbar-right"> @{ Html.RenderAction("PartialInfo", "Profile"); } (1) </ul> The PartialInfo method is asynchronous.
[ChildActionOnly] public async Task<PartialViewResult> PartialInfo() { var user = await userService.GetByEmailAsync(User.Identity.Name); ... During rendering, line (1) crashes
HttpServerUtility.Execute is blocked until the end of the asynchronous operation.
I would like to know why an error occurs and why the developers have banned the asynchronous execution of methods for insertion.
ps I know that if you change to the synchronous version, everything will be ok