【发布时间】:2009-09-13 14:39:05
【问题描述】:
我有一个 ASP.NET MVC 2.0 Preview 1 应用程序并开始创建一些包含自己的路线的区域。
我想有办法在主项目中覆盖这些路由。我当然不能添加同名的新路线。我可以看到 RouteTable.Routes.Remove(RouteBase item) 但不知道如何使用它。
//Need to remove "PostIndex" before adding it again
routes.MapAreaRoute(
"OurAreaNameSpace",
"PostIndex",
"post/index/{currentPage}",
new { controller = "Post", action = "Index", currentPage = "" },
new string[] { "OurAreaNameSpace.Controllers" }
);
【问题讨论】:
标签: asp.net-mvc asp.net-mvc-routing