@ Html.Action正在提升" HttpServerUtility.Execute在等待异步操作完成时被阻塞。 "

时间:2015-01-22 00:49:54

标签: c# asp.net asp.net-mvc asynchronous asp.net-mvc-5

我正在开发一个asp.net mvc5.2.2。 Web应用程序,我在我的视图中有以下代码: -

@Html.Action("Index", "Skill")

将调用以下Action方法: -

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);
        }

但我会在视图上收到以下错误: -

  

HttpServerUtility.Execute在等待异步时被阻止   操作完成。描述:发生了未处理的异常   在执行当前Web请求期间。请查看   堆栈跟踪以获取有关错误及其位置的更多信息   起源于代码。

     

异常详细信息:System.InvalidOperationException:   HttpServerUtility.Execute在等待异步时被阻塞   操作完成。

     

来源错误:

     

第172行:第173行:行   174:@ Html.Action(“索引”,“技能”)第175行:

第176行:
  @ Html.ActionLink(“编辑”,“编辑”,新{id = Model.StaffID})|

0 个答案:

没有答案