通过urlparams将数组发送到控制器动作
我有一个AffairesController
的Action Reportssrs
public async Task<IActionResult> ReportSsrs(
int affaireId,
int[] coucheIds = null,
int[] secteurIds = null)
{
return ...
}
我想发送一个事件ID和两个IDS Couche
和secteur
我尝试使用以下URL,
//localhost:5001/affaires/reportssrs?affaireId=9&coucheIds[]=10§eurIds[]=23
但是当我放置断点并击中操作时得到的是什么,似乎并不是很好,阵列值:
通过URL将数组传递到动作的正确方法是什么?
I have the action ReportSsrs
of a AffairesController
public async Task<IActionResult> ReportSsrs(
int affaireId,
int[] coucheIds = null,
int[] secteurIds = null)
{
return ...
}
I want to send an affair id and two arrays of ids couche
and secteur
I try to use the following URL
//localhost:5001/affaires/reportssrs?affaireId=9&coucheIds[]=10§eurIds[]=23
however what I get when I put a breakpoint and the action is hit, it does not seem to pass very well, the array value:
What is the correct way to pass an array via the URL to the action?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
正确的URL应该是:
如果您的数组包含多个项目,则URL应该是:
The correct url should be:
If your array contains more than one item, the url should be: