如何将 int 数组从 $.ajax 发送到 c# mvc?
最佳答案
$.ajax({
url: <Url of the action>,
type: "POST",
data: JSON.stringify([1,2,3]),
dataType: "json",
contentType: 'application/json; charset=utf-8'
});
并在行动中。
public ActionResult ReceiveIntArray(int[] ints)
{
...
}
mvc 应该自动解析 json。
关于ajax - 如何将 int 数组从 ajax 发送到 c# mvc?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9109544/