2
生成URL如果我有一些路线设置如下:从ASP.NET MVC路线
context.MapRoute("Route1", "Public/DataCapture/Name", new { controller = "Profile", action = "Name" });
context.MapRoute("Route2", "Public/DataCapture/Age", new { controller = "Profile", action = "Age" });
context.MapRoute("Route2", "Public/DataCapture/Amount", new { controller = "Income", action = "Amount" });
怎样才能使用的路由路径,而不是实际控制人/动作路径网址吗?
E.g.
Url.Action("Name", "Profile")
应该生成 “公共/ DataCapture /名称”,而不是 “公共/资料/名称”
谢谢,这似乎是伎俩。现在看起来很明显。甚至没有检查过这样的方法。 – 2011-04-14 19:04:58