Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
new ViewResult() { ViewName = "Error_403" };
在这种情况下,.net 会查看当前控制器视图目录 (~/Views/Home/) 和共享目录 (~/Views/Shared/)
有没有办法在这里指向特定的目录ViewName = @"Errors\Error_403"? 或者可能是任何其他简单的解决方案?
ViewName = @"Errors\Error_403"
尝试这样的事情:
New ViewResult(){ViewName="~/Views/SomeDir/Error_403.aspx"};
有关类似问题,请参见此处:StackOverflow