【发布时间】:2019-06-16 09:56:11
【问题描述】:
我正在向 this ASP.NET Core Razor Pages tutorial 学习,我正在努力使其适应我的需求。对于分页链接,缩短为:
<a asp-page="./Index"
asp-route-pageIndex="@(Model.Student.PageIndex + 1)"
asp-route-currentFilter="@Model.CurrentFilter"
class="btn btn-default">
Next
</a>
我找不到如何处理 asp-route-{variable} 的说明,其中变量(sn-p 中的 currentFilter)是一个数组。就我而言,在我看来,我已将 CurrentFilter 调整为具有多个属性的选择框,它在 URL 中显示如下:
https://localhost/Student/?currentFilter=foo¤tFilter=bar
它以字符串数组的形式进入我的模型。我找不到任何关于如何使用 asp-route 标签助手将数组传递到查询字符串的文档或解决方案。
【问题讨论】:
标签: c# asp.net-core razor-pages