Ant*_*hin 22 arrays ajax asp.net-mvc jquery asp.net-ajax
如何将$ .ajax中的int数组发送到c#mvc?
Dan*_*iel 37
$.ajax({
url: <Url of the action>,
type: "POST",
data: JSON.stringify([1,2,3]),
dataType: "json",
contentType: 'application/json; charset=utf-8'
});
Run Code Online (Sandbox Code Playgroud)
并在行动中.
public ActionResult ReceiveIntArray(int[] ints)
{
...
}
Run Code Online (Sandbox Code Playgroud)
mvc应该自动解析json.
看看这个问题.
| 归档时间: |
|
| 查看次数: |
39819 次 |
| 最近记录: |