我刚升级到MVC3决赛,我以前工作的部分网站完全停止了工作。知道我的网址已经消失或者如何取回它们了吗?
全球
routes.MapRoute(
"SingleArticle",
"Articles/{action}/{year}/{month}/{day}/{key}",
new { controller = "Articles", action = "Archive", year = 0, month = 0, day = 0, key = "" },
new { year = @"\d{4}", month = @"\d{2}", day = @"\d{2}" }
);
CSHTML
var routeLinkData = new {
action = "Archive",
year = item.PublishDate.Value.Year,
month = item.PublishDate.Value.Month,
day = item.PublishDate.Value.Day,
key = item.NameKey };
URL="@Url.RouteUrl("SingleArticle", routeLinkData)"
Link="<a href="@Url.RouteUrl("SingleArticle", routeLinkData)">Link</a>"
输出
URL=""
Link="<a href="">Link</a>"
答案 0 :(得分:0)
最终结果是对路由和不正确的正则表达式的默认值的需求发生了变化。