开发者

Route doesnt register

开发者 https://www.devze.com 2022-12-11 13:48 出处:网络
I have this route registered: routes.IgnoreRoute(\"{resource}.axd/{*pathInfo}\"); routes.MapRoute( \"Views\", \"View/{RouteID}\",

I have this route registered:

routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

        routes.MapRoute(
            "Views", "View/{RouteID}", 
            new 开发者_如何学Python{ controller = "BookingViewsPublicController", 
                action = "Index", RouteID = "" }
                );


        routes.MapRoute(
            "Default",                                              // Route name
            "{controller}/{action}/{id}",                           // URL with parameters
            new { controller = "Home", action = "Index", id = "" }  // Parameter defaults

And I cant get like http://localhost:49764/View/Foo to work, I still have to go to /BookingViewsPublic/?RouteID=Foo for it to work. What might be wrong?

/M


Resolved

"BookingViewsPublic" not "BookingViewsPublicController" in route-registration


Problem was that I had the word "Controller" in the route, so BookingViewsPublic and NOT BookingViewsPublicController.

0

精彩评论

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

关注公众号