我在尝试在 ASP.NET MVC 3 中使用路由时遇到了一些麻烦。我在这个 URL 中:
mysite/InitialPage/123456 <- 合作伙伴 ID
路由它...
routes.MapRoute(
"InitialPageRoute",
"InitialPage/{partnerID}",
new { controller = "InitialPage", action = "Index" }
);
好的,它工作正常。当我把 Html.ActionLink 重定向到另一个页面时......
@Html.ActionLink("Another copy of some bill", "CopyOfBill", "Payment", new { partnerID = ViewBag.PartnerID })
并以这种方式路由...
routes.MapRoute(
"CopyOfBillRoute",
"Payment/CopyOfBill/{partnerID}",
new { controller = "Payment", action = "CopyOfBill" }
);
并且不起作用。有人知道吗?
谢谢!!!