错误的视图处理程序执行子请求 [英] Error executing child request for handler in view
问题描述
我有一个MVC 4观点,我作出以下行为
I have an MVC 4 view where I render the following actions
@{
Html.RenderAction("Index", "Logo");
Html.RenderAction("Index", "MainMenu");
}
我有我的看法是填写并贴到控制器的形式。在控制器我执行一些任务,然后把模型恢复我的看法
I have a form on my view which is filled out and posted to the controller. In the controller I perform some tasks and then send the model back to my view
[HttpPost]
public ActionResult Index(ManageAdministratorModel manageAdministratorModel)
{
// I save some of the fields to the database here.
return View(manageAdministratorModel);
}
当我重定向到我收到以下错误的看法
When I'm redirected to the view I receive the following error
执行的处理程序System.Web.Mvc.HttpHandlerUtil + ServerExecuteHttpHandlerAsyncWrapper'子请求时出错。
Error executing child request for handler 'System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerAsyncWrapper'.
在此行
Html.RenderAction("Index", "Logo");
任何想法,为什么会这样?
Any idea why this is happening?
推荐答案
好吧,我发现这个问题,希望这将帮助别人的未来。
Ok I found the problem, hopefully this will help someone in future.
对于部分景观的每个控制器包含在 [HTTPGET]
属性。例如:
The controllers for the partial views each contained the [HttpGet]
attribute. For example
[HttpGet]
public ActionResult Index()
{
}
我从两个控制器删除属性。
I remove the attribute from both controllers
public ActionResult Index()
{
}
和一切工作了。
这篇关于错误的视图处理程序执行子请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!