I am working on an asp.net mvc5.2.2. web application, and i have the following code inside my view:-
@Html.Action("Index", "Skill")
which will call the following Action method:-
public async Task<ActionResult> Index(string filter = null, int page = 1, int pageSize = 20, string sort = "Name", string sortdir = "DESC")
{
var records = new PagedList<Skill>();
ViewBag.filter = filter;
records.Content = await skillRepository.GetSkillForGrid(filter, page, pageSize, sort, sortdir).Where(a => a.IsActive).ToListAsync();
// Count
records.TotalRecords = skillRepository.GetSkillForGridCount(filter, true);
records.CurrentPage = page;
records.PageSize = pageSize;
return View(records);
}
but i will get the following error on the view:-
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:
Line 172: Line 173: Line 174:@Html.Action("Index", "Skill") Line 175:
Line 176:
@Html.ActionLink("Edit", "Edit", new { id = Model.StaffID }) |