3
在旧版本的MVC 5的我能做到这一点通过路由参数天冬氨酸行动路线数据
@Html.ActionLink("New item", "Suggestion", new ProductSuggestion() { Username = Model.Username }, new { @class = "btn btn-default" })
我试图让这个与新的ASP-action方法工作,我figgured了我所能做这个解决方法。但是,这是什么正确的语法?
@{
var a = new Dictionary<string, string> { { "Username", Model.Username } };
}
<a asp-action="Suggestion" asp-all-route-data="a" class="btn btn-default">New item</a>
也许[this](http://stackoverflow.com/questions/30020892/taghelper-for-passing-route-values-as-part-of-a-link)可以帮助你。 –
没有MVC6(再)! https://blogs.msdn.microsoft.com/webdev/2016/01/19/asp-net-5-is-dead-introducing-asp-net-core-1-0-and-net-core-1- 0/ – Tseng
这实际上并没有说什么MVC将被称为什么。 .Net Core 1.0就是这个框架。 – stibay