的话可能 2016-12-15 07:49 采纳率: 0%
浏览 5557

mvc,未找到视图或其母版视图,或没有视图引擎支持搜索的位置

The view '~/Views/Home/Login.cshtml' or its master was not found or no view engine supports the searched locations. The following locations were searched:
~/Views/Home/Login.cshtml

说明: 执行当前 Web 请求期间,出现未经处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。

异常详细信息: System.InvalidOperationException: The view '~/Views/Home/Login.cshtml' or its master was not found or no view engine supports the searched locations. The following locations were searched:
~/Views/Home/Login.cshtml

我的controller这样写的:
public ActionResult Login()
{
return View("~/Views/Home/Login.cshtml");
}

  • 写回答

5条回答 默认 最新

  • threenewbee 2016-12-15 16:20
    关注

    return View(); 即可。

    评论

报告相同问题?

悬赏问题

  • ¥20 idea运行测试代码报错问题
  • ¥15 网络监控:网络故障告警通知
  • ¥15 django项目运行报编码错误
  • ¥15 请问这个是什么意思?
  • ¥15 STM32驱动继电器
  • ¥15 Windows server update services
  • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏
  • ¥15 模糊pid与pid仿真结果几乎一样
  • ¥15 java的GUI的运用
  • ¥15 我想付费需要AKM公司DSP开发资料及相关开发。