【发布时间】:2010-10-09 16:40:30
【问题描述】:
我有一条看起来像这样的路线(但我尝试了几种不同的路线):
routes.MapRoute(
"Metrics",
"Metrics/{action}/{id}/{resource}/{period}",
new { controller = "Metrics" }
);
在MetricsController我有以下操作:
// Index sets up our UI
public ActionResult Index(int id, string resource, string period)
// GetMetrics returns json consumed by ajax graphing tool
public JsonResult GetMetrics(int id, string resource, string period)
我如何生成链接并且在 url 中没有 Index 以便我可以这样做?:
我尝试了各种Html.ActionLink 和Html.RouteLink 的咒语,但没有任何乐趣。
【问题讨论】:
标签: asp.net-mvc-2 url-routing asp.net-mvc-routing