Error executing child request for handler in view

后端 未结 12 923
臣服心动
臣服心动 2020-12-09 02:30

I have an MVC 4 view where I render the following actions

@{
    Html.RenderAction(\"Index\", \"Logo\");
    Html.RenderAction(\"Index\", \"MainMenu\");
}
         


        
12条回答
  •  温柔的废话
    2020-12-09 03:07

    This happened to me, because I was calling the view from different areas.

    The view I wanted to call was not within an area, so when calling it from outside of all areas a call like

    @Html.RenderAction("Index", "Logo");

    would work without problems.

    But when I wanted that same view called from another view that was inside an area, I would have to add some additional information to the call to make it explicit:

    @Html.RenderAction("Index", "Logo", new { area = "" });

提交回复
热议问题