大师们,
我已经定义了如下几条路线。
routes.MapRoute(
name: "Default1",
url: "{a}",
defaults: new { controller = "Home", action = "Index" }
);
routes.MapRoute(
name: "Default2",
url: "{a}/{b}",
defaults: new { controller = "Home", action = "Index" }
);
routes.MapRoute(
name: "Default3",
url: "{a}/{b}/{c}",
defaults: new { controller = "Home", action = "Index" }
);
routes.MapRoute(
name: "Default4",
url: "{a}/{b}/{c}/{d}",
defaults: new { controller = "Home", action = "Index" }
);
在 HomeController 中,
public ActionResult Index(dynamic data)
{
return View();
}
我在Index方法的开头设置了一个断点现在,当我点击如下 URL 时: http://{MylocalIP:port}/a/b 停留在断点上。但我无法提取 a & b 的路由值。
我们应该怎么做?请帮忙。
提前致谢