给出以下路由:
routes.MapRoute(
"RouteName", // Route name
"ViewFoo/{FooId}",
new { controller = "Foo", action = "View"}
);
对应以下操作方法:
public ActionResult View(string fooId = null)
{
...blah...
}
准确地说,如何调用Url.Action()
来获取字符串'/ ViewFoo / 4'?或者我需要以某种方式修改路由?
答案 0 :(得分:0)
Url.Action("View", "Foo", new { FooId = 4 })