对于我的自定义分页,我想将一个 int 数组添加到查询字符串(过滤)
这是我在视图中的代码:
@foreach(var page in ViewBag.pagination){
string index = Convert.ToString(page.index);
if (page.skills != null)
{
<li>@Html.ActionLink(index, "index", "vacancy", new { skills= string.Join("&skills=", page.skills)}, null)</li>
}
else
{
<li>@Html.ActionLink(index, "index", "vacancy", new {page = page.index}, null)</li>
}
}
这条线
<li>@Html.ActionLink(index, "index", "vacancy", new { skills= string.Join("&skills=", page.skills)}, null)</li>
结果:?skills=1%26skills%3D2
但是我怎样才能将查询字符串更改为: ?skills=1&skills=2 ?