MVC Razor文件中的InsufficentExecutionStackException

Ada*_*one 2 asp.net-mvc razor

所以我正在尝试使用asp net mvc 4.5,我在登录razor视图中工作.这个页面与其他页面不同,所以我在顶部

@model HSServer.Models.LoginModel

@{
    ViewBag.Title = "Log in";
    Layout = null;
}
Run Code Online (Sandbox Code Playgroud)

Layout = null;这样它不使用母版页.

我尝试运行该应用程序,并在该行上抛出一个InsufficentExecutionStackException Layout = null;并说

Insufficient stack to continue executing the program safely. This can happen from
having too many functions on the call stack or function on the stack using too
much stack space.
Run Code Online (Sandbox Code Playgroud)

任何人都可以告诉我发生了什么!

编辑

它似乎与Layout = null删除无关,并没有帮助,只是简单地将错误移动了一行.仍在挖掘.

Ada*_*one 5

得到它了.我在不知情的情况下复制了这个.

在我打电话的身体里,@Html.Action("Login")而不是@Url.Action("Login")我想要的.该页面递归调用自己,而不是简单地给我一个网址...哎呀.