0

尝试使用 Html.Action 将页面呈现为局部视图时出现以下错误:

执行处理程序“System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerAsyncWrapper”的子请求时出错

查看代码:

@Html.Action("Index", "Location", new { userId = 3428 })

控制器代码:

public class Location : Controller
{
    private void PopulateDropdowns(LocationViewModel model, int userId)
    {
        var lookup = new AWS.BL.Lookup();

        model.Areas = lookup.GetAreas(userId);
        model.SEATs = new List<DTO.Lookup>();
        model.Establishments = new List<DTO.Lookup>();
        model.Properties = new List<DTO.Lookup>();
    }

    public ActionResult Index(int userId)
    {
        var model = new LocationViewModel();
        PopulateDropdowns(model, userId);
        return PartialView(model);
    }
}

非常感谢任何帮助。

4

0 回答 0