开发者

MVC3 not finding resources

开发者 https://www.devze.com 2023-03-29 04:48 出处:网络
I\'m trying to start a mvc3 website. But when I load the 开发者_如何学Pythonserver I get this error.

I'm trying to start a mvc3 website. But when I load the 开发者_如何学Pythonserver 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
           );
        }


I noted that you have two possibly conflicting route registrations. Try removing the first registration and leaving only this one:

           routes.MapRoute(
               "States",
               "{controller}/{action}/{id}",
               new { controller = "States", action = "Index", id = "" }
           );
0

精彩评论

暂无评论...
验证码 换一张
取 消