简体   繁体   English

ASP.NET MVC 5 中的“资源未找到或暂时不可用”错误

[英]"Resource not found or temporarily unavailable" error in ASP.NET MVC 5

The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.您正在寻找的资源(或其依赖项之一)可能已被删除、更改名称或暂时不可用。 Please review the following URL and make sure that it is spelled correctly.请检查以下 URL 并确保其拼写正确。

Index.cshtml索引.cshtml

@{
    ViewBag.Title = "Index";
    Layout = "Null";
}

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>Index</title>
</head>
<body>
    <div>
        <p>Welcome to the first application of MVC</p>
    </div>
</body>
</html>

firstcintroller.cs firstcintroller.cs

namespace mvcapp.Controllers
{ 
    public class firstController : Controller
    {
        // GET: first
        public ActionResult Index()
        {
            return View();
        }
    }
}

Make sure the controller name is “first” in yout RouteConfig.cs file in App_Start folder.确保控制器名称在 App_Start 文件夹中的 RouteConfig.cs 文件中为“first”。

And, create a folder with name “first” file in Mvc\\Views folder and place Index.cshtml inside first folder and execute the project.然后,在 Mvc\\Views 文件夹中创建一个名为“first”文件的文件夹,并将 Index.cshtml 放在第一个文件夹中并执行项目。

For more information, find below URL:有关更多信息,请查找以下网址:

ASP.NET MVC Page Won't Load and says "The resource cannot be found" ASP.NET MVC 页面不会加载并显示“找不到资源”

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

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