【发布时间】:2016-08-25 10:22:21
【问题描述】:
我正在使用nopCommerce,我想将我的默认路由从 Index 更改为另一个 ActionResult Promotion,它也存在于同一 HomeController 中,我做了以下这些技巧,但没有解决办法,
在 Nop.Web\Infrastructure\RouteProvider.cs 中
//home page
routes.MapLocalizedRoute("HomePage",
"",
new { controller = "Home", action = "Index" },
new[] { "Nop.Web.Controllers" });
//for promotion
routes.MapLocalizedRoute("Promotion",
"",
new { controller = "Home", action = "Promotion" },
new[] { "Nop.Web.Controllers" });
在 Global.asax 中
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Promotion", id = UrlParameter.Optional }, // changed to Promotion
new[] { "Nop.Web.Controllers" }
);
【问题讨论】:
-
评论默认路由
-
@Div 异常:
No route in the route table matches the supplied values
标签: asp.net-mvc asp.net-mvc-routing nopcommerce