简体   繁体   English

.cshtml文件中的Http 404错误

[英]Http 404 error on .cshtml file

I started getting a 404 error on one of my ASP.NET MVC cshtml file. 我开始在我的一个ASP.NET MVC cshtml文件中收到404错误。 Previously it had been found. 以前它已被发现。 What is really throwing me off is that, if I right click on any .cshtml file in Visual Studio 2013's Solution Explorer and choose to view in browser, I can see the results in the browser. 真正让我失望的是,如果我右键单击Visual Studio 2013的解决方案资源管理器中的任何.cshtml文件并选择在浏览器中查看,我可以在浏览器中看到结果。 But, if I right click on this one file and choose view in browser, I get a 404 error. 但是,如果我右键单击这个文件并在浏览器中选择视图,我会收到404错误。 Anyone know what gives? 谁知道什么给了?

Be sure that your URL is pointing to one valid MVC Route (Controller/Action). 确保您的URL指向一个有效的MVC路由(控制器/操作)。

In most cases, if the view can't be found it will be throw an error message with locations searched for it. 在大多数情况下,如果找不到视图,它将抛出一个错误消息,其中搜索的位置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM