MVC3找不到资源
我正在尝试启动一个 mvc3 网站。但是当我加载服务器时我收到此错误。
描述:HTTP 404。您正在查找的资源(或其其中之一) 依赖项)可能已被删除,其名称已更改,或者是 暂时无法使用。请检查以下 URL 并进行 确保拼写正确。
我的路线文件看起来像这样
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = "" } // Parameter defaults
);
routes.MapRoute(
"States", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "States", action = "Index", id = "" } // Parameter defaults
);
}
I'm trying to start a mvc3 website. But when I load the server I get this error.
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.
My routes file looks like this
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = "" } // Parameter defaults
);
routes.MapRoute(
"States", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "States", action = "Index", id = "" } // Parameter defaults
);
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我注意到您有两个可能存在冲突的路线注册。尝试删除第一个注册并只保留这个:
I noted that you have two possibly conflicting route registrations. Try removing the first registration and leaving only this one: