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.
精彩评论