asp-action taghelper保留父URL

时间:2019-02-28 14:58:23

标签: asp.net-mvc asp.net-core

从dotnet core 2.1迁移到2.2之后,这段代码更改了其行为:

<a asp-action="Create">Create</a>

在dotnet core 2.1上,它曾经产生以下URL:

/Forms/EquipmentGroupAssociation/4819144/Create

但是在2.2上,这个

/Forms/EquipmentGroupAssociation/Create

这是控制器操作:

[HttpGet("[area]/[controller]/{parentID:long}")]
public virtual ActionResult Index(long parentID)
{
    return View("Index");
}

基本网址:

/Forms/EquipmentGroupAssociation/4819144

0 个答案:

没有答案