2013-09-25 56 views
0

目前,我与MVC4。我的工作有疑问,我试图调试时index.cshtml是开放的, 它显示Server Error in '/' Application浏览器显示服务器错误“/”应用MVC4

无法找到该资源。

描述:HTTP 404.您正在查找的资源(或其某个依赖项)可能已被删除,名称已更改或暂时不可用。请检查以下网址并确保它拼写正确。

Requested URL: /Views/Report/Index.cshtml 

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.17929. 

当我和其他的页面比index.cshtml调试,它的工作原理fine.Why它发生?你可以给解决吗?

+0

检查路由和查看名称 – 2013-09-25 05:39:20

+0

检查你有一个index.cshtml在Views / –

回答

2

我认为你是错的请求URL:/Views/Report/Index.cshtml

应该主机名/报告/索引http://localhost/Report/Index

2

要调用它错误的方式..

你的要求模式应该如下:

ControllerName/ActionName

因此您的申请sholud是http://localhost/Report/Index

的过程如下:

  1. 当你将达到http://localhost/Report/Index
  2. 您的请求将被重定向到位于ReportController.cs
  3. 然后Index ActionIndex Action会返回位于"Views/Report"文件夹中的Index.cshtmlview
相关问题