c# - "Child actions are not allowed to perform redirect actions"

标签 c# asp.net-mvc-3

我有这个错误:

Error executing child request for handler 'System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerAsyncWrapper'.

有内部异常:

Child actions are not allowed to perform redirect actions.

知道为什么会这样吗?

顺便说一句,错误发生在这一行:

@Html.Action("Menu", "Navigation")

导航 Controller 中的菜单操作如下所示:

public ActionResult Menu()
{
    return PartialView();
}

最佳答案

这发生在我身上,因为我在 Controller 上有 [RequireHttps],并且从另一个 Controller 调用了子操作。 RequireHttps 属性导致重定向

关于c# - "Child actions are not allowed to perform redirect actions",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8924529/

相关文章:

c# - Windows窗体中的线程

c# - 在 Identity Asp.net core 3 MVC 中创建服务 IUserStore 时出错

javascript - 为 ajax 帖子手动调用 MVC 3 客户端验证

asp.net-mvc-3 - RDLC 报告与 ASP.net MVC 3.0

asp.net-mvc - 与 MVC3 和 ASP.NET4.5 异步

c# - 如何调试此 Web 服务?

c# - 为什么动态创建的用户控件会在控件未执行完整回发时消失?

C# - 我知道,我知道,关于 Dispose 的另一个问题(与设计更相关)!

asp.net - MVC3 Controller 文件夹不会出现在 URL 中

jQuery UI 选项卡未呈现