开发者

ASP.NET MVC 404 Even When Route Exists

开发者 https://www.devze.com 2023-03-17 20:08 出处:网络
I have created a standard ASP.NET MVC 3 Project (Razor) and have not modified Register Routes at all public static void RegisterRoutes(RouteCollection routes)

I have created a standard ASP.NET MVC 3 Project (Razor) and have not modified Register Routes at all

  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 = UrlParameter.Optional } // Parameter defaults
        );

    }

For no reason I can find suddenly none of the urls work, I get a HTTP 404 all the time, both in Cassinin and IIS7 where before it worked... I have tried the Route开发者_运维知识库Debug tool and it seems to show that the view matches, yet when I turn it off again I once again get 404s


If you not do anything on it, I think just one reason: your IIS has problem. Sorry I can't suggest solution because this is my first time I see it.

0

精彩评论

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