我设置了以下路线:
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 操作的单个路由?