Error executing child request for handler in view

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

    I got this error, but my problem was diferent. To see what is the error about, involve the line you get the error inside a try catch code, like this:

     try 
        {           
             @Html.RenderAction("Index", "Logo", new {id = Model.id});
        }
        catch (Exception e)
        {
            throw;
        }    
    

    Execute it with a break point at throw line and check the inner exception of the 'e'. My problem was that I'd changed the parameter name on my Controller and forgot to change it on my View.

    It's easier to get the error using try catch.

提交回复
热议问题