【发布时间】:2012-09-02 04:31:54
【问题描述】:
我设置了以下路线:
context.MapRoute(
"content_article",
"A{rk}/{title}",
new { controller = "Server", action = "Article" },
new { rk = @"^[\dA-Z]{3}$" }
);
context.MapRoute(
"content_contentBlock",
"C{rk}/{title}",
new { controller = "Server", action = "ContentBlock" },
new { rk = @"^[\dA-Z]{3}$" }
);
context.MapRoute(
"content_favoritesList",
"F{rk}/{title}",
new { controller = "Server", action = "FavoritesList" },
new { rk = @"^[\dA-Z]{3}$" }
);
有没有办法可以结合:
"A{rk}/{title}",
"C{rk}/{title}",
"F{rk}/{title}",
如果 URL 以 A、C 或 F 开头,则进入一个带有 Index 操作的单个路由?
【问题讨论】:
标签: asp.net-mvc asp.net-mvc-3 asp.net-mvc-routing