【问题标题】:cant render view via renderAction无法通过 renderAction 渲染视图
【发布时间】:2012-08-06 04:15:21
【问题描述】:

您好,我正在使用 RenderAction 助手,在渲染过程中出现此错误:

执行子请求时出错 处理程序 'System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerAsyncWrapper'。

控制器代码:

public ActionResult GetSearcher()
        {

            SearcherLines sl = new SearcherLines()
            {
                RegionList = db.Region.ToList(),
                CategoryList = db.Category.ToList(),
                SearchValue = null
            };

            return PartialView(sl);
        }

视图模型

public class SearcherLines
    {
        public List<Region> RegionList { get; set; }
        public List<Category> CategoryList { get; set; }
        public string SearchValue { get; set; }
    }

部分视图

@model IEnumerable<MasterProject.JobForYou.v3.Models.ViewModels.SearcherLines>

@foreach (var i in Model)
{
  <p>@i.CategoryList</p><br />
}

请帮忙。

【问题讨论】:

    标签: asp.net-mvc-3


    【解决方案1】:

    尝试在控制器动作上设置 OutputCache 属性

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-06-20
      • 1970-01-01
      • 1970-01-01
      • 2021-02-10
      相关资源
      最近更新 更多