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