我试图返回我的链接,因此它们显示为/Area_1419.aspx/2/1。路线链接 - Url.Action
我已经设法在例子2中得到这个结果,但我不明白它为什么会起作用,因为我会看到下面的例子1工作。
我不明白例2知道如何去Area_1419控制器?
路线
routes.MapRoute(
"Area_1419 Section",
"Area_1419.aspx/{section_ID}/{course_ID}",
new { controller = "Home", action = "Index" }
);
捷径实施例1
<a href='<%=Url.Action("Area_1419",
new { section_ID="2", course_ID="1" })%>'><img .../></a>
返回:/Home.aspx/Area_1419?section_ID=2 & COURSE_ID = 1个
链接例2
<a href='<%=Url.Action("index",
new { section_ID="2", course_ID="1" })%>'><img .../></a>
返回:/Area_1419.aspx/2/1
我更新了路线,但链接<%= Url.Action(“Area_1419”,new {section_ID =“2”,course_ID =“1”})%>仍然返回/Home.aspx/Area_1419?section_ID = 2&course_ID = 1 – Jemes 2010-03-15 12:27:20
@Jemes检查我的更新:) – 2010-03-15 12:48:14
非常感谢! – Jemes 2010-03-15 12:59:14