我为我的网站设置了以下结构。 (见下面的链接) http://postimg.org/image/ut4klihrp/
我基本上想要'默认' route(localhost:62540)去我的WWW项目。我怎么能这样做,或者有人知道教程是解释这个问题的原则吗?或者这是不可能的,因为我使用区域方法。 最终我想从核心项目中删除视图和控制器。
在www:
中路由配置routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional },
namespaces: new string[] { "WWW.Controllers" }
);
答案 0 :(得分:0)
您可以在defaults
:
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { area = "www", controller = "Home", action = "Index", id = UrlParameter.Optional },
namespaces: new string[] { "WWW.Controllers" }
);