无法找到具有硬编码控制器和动作的Asp mvc地图网址

时间:2014-07-15 14:35:55

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

我有下一个地图网址定义,我想为特殊网址设置特定操作和控制器: // localhost:55321 / SpecificPart / UserTextId所有其他路由应以默认方式工作

但是基于Route Debugger我的URL映射到我的主路由规则如何处理这种情况?

routes.MapRoute(
                "PartnerSighUp",
                "SpecificPart/{id}",
                  new { controller = "SpecificController ", action = "SpecificAction" },
                  new { id = "[A-Za-z].+" }
           );

   routes.MapRoute(
                name: "EnglishHomePage",
                url: "",
                defaults: new { culture = "en", controller = "Home", action = "Index", id = UrlParameter.Optional }
                );

            routes.MapRoute(
                name: "Default",
                url: "{culture}/{controller}/{action}/{id}",
                defaults: new { controller = "Home", action = "Index", culture = "en", id = UrlParameter.Optional }
                );

更新如果SpecificPart = SpecificController(控制器名称)它正在工作,但如果是SpecificPart!= SpecificController并且看向其他控制器它无法正常工作

0 个答案:

没有答案