MVC4路由问题

时间:2013-11-15 17:35:29

标签: asp.net-mvc-4 asp.net-mvc-routing

我有几个项目引用路由中的外部项目中的控制器。因此,项目A,B和C共享Core项目D中的控制器。

项目A和B工作正常,但对于项目C,路由将工作并重定向,但URL不会重写以匹配路由。

Here is an example of a custom route and the default route:
   routes.MapRouteLowercase(
                "AssistedLivingByLocation", // Route name
                "Assisted-Living/{state}/{city}/{zip}", // URL with parameters
                new { controller = "AssistedLiving", action = "Results", zip = UrlParameter.Optional }// } ;

routes.MapRouteLowercase(
            "Default",
            "{controller}/{action}/{id}",
            new { controller = "Home", action = "Index", id = UrlParameter.Optional },
            new[] { "Core.Controllers" }
        );

正在调用辅助生活控制器,州和城市参数正在通过。将显示生成的部分视图,但不会重写URL。就像我说的,所有这些相同的代码都适用于其他两个项目。

我错过了什么?

0 个答案:

没有答案