【发布时间】:2019-05-10 18:55:48
【问题描述】:
假设我想使用像 http://localhost/Controller/1/ChildController/Edit/1 这样的 URL 来访问 ASP.NET MVC 5 项目中父记录的子记录。
使用属性路由我们可以像下面这样路由。
[Route("Controller/{id:int}/ChildController/Edit/{childId:int}")]
public ActionResult EditChildRecord(int id, int childId)
{
return View();
}
如何在基于约定的路由中实现相同的功能?
谢谢。
【问题讨论】:
标签: c# asp.net-mvc asp.net-mvc-routing