1

(注意:我是 ASP.NET MVC 世界的初学者......)环境:Visual Studio 2012 项目应用程序:ASP.NET MVC 4.0

我确实将 /views/home/index.html 设置为起始页......事情并没有如我所愿,我无法调试。错误消息说:


Server Error in '/' Application.
--------------------------------------------------------------------------------
The resource cannot be found. 
Description: HTTP 404. 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. 
Requested URL: /Views/Home/Index.cshtml

现在我想知道我怎么后悔这个举动...我什至不知道从哪个文件开始设置为启动页面...</p>

哪个文件通常是默认的启动文件?我可以从“启动页面”中释放文件吗?我在另一台计算机上也有旧版本。Environment Vs 2010. 我可以在那里看到哪个文件设置为起始页吗?

我很感激任何提示或解决方案来解决我的任务……谢谢。希望这些信息足以让您了解我的问题。如果不是,我会尽量让它更容易理解。

以下答案后使用的解决方案:我在“项目菜单”中选择了“yourprojectname-properties”。然后在属性窗口中选择“Web”。然后添加 / 如上所述...对于所有在我的这个问题上花了一些时间的人...你摇滚!没有明天...

4

1 回答 1

0

您必须将 route-url 设置为 starturl,而不是页面。在 ASP.NET MVC 中,您必须使用路由,并且每个路由都映射到一个操作。

于 2013-03-22T09:29:04.300 回答