Error executing child request for handler in view

后端 未结 12 951
臣服心动
臣服心动 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:12

    I had exactly the same problem, and because I was using attribute routing, the inner exception error message was:

    No matching action was found on controller ''. 
    This can happen when a controller uses RouteAttribute for routing, 
    but no action on that controller matches the request.
    

    Remove the [HttpGet] attributes from action methods called by Html.Action() and it works. Nothing to do with routing.

提交回复
热议问题