我如何为路由添加整数列表
|
我正在尝试将int []数组添加到我的Url.Action中,如下所示:
var routeData = new RouteValueDictionary();
for (int i = 0; i < Model.GroupsId.Length; i++) {
routeData.Add(\"GroupsId[\" + i + \"]\", Model.GroupsId[i]);
}
在我看来:
Url.Action(\"Index\", routeData)
但是在html中,我得到了:
GroupsId%5B0%5D=1213&GroupsId%5B0%5D=1214
并不是:
GroupsId=1213&GroupsId=1214
我需要它是因为我有一个复选框列表,当我发布时,我将groupIds绑定到int [],然后传递给我查看带有Url.Action的导出按钮的位置,该按钮对我而言无法正常工作。
没有找到相关结果
已邀请:
1 个回复
晤默报