0

给定以下路由:

routes.MapRoute(
                "RouteName", // Route name
                "ViewFoo/{FooId}",
                new { controller = "Foo", action = "View"}
            );

对应如下动作方法:

public ActionResult View(string fooId = null)
{
  ...blah...
}

确切地说,我将如何调用Url.Action()来获取字符串'/ViewFoo/4'?还是我需要以某种方式修改路由?

4

1 回答 1

0
Url.Action("View", "Foo", new { FooId = 4 })
于 2013-01-10T19:15:14.483 回答