我试图以这种方式访问视图:
return View(@"~\Items\Details.aspx");
我收到这个错误:
The view ‘~\Items\Details.aspx’ or its master could not be found. The following locations were searched:
~\Items\Details.aspx
在ItemsController上,在Details操作中,返回的View()工作正常.为什么我无法从另一个控制器访问该视图?
解决方法
用’/ Views’替代它应该有帮助.
return View("~/Views/Items/Details.aspx");