通过ajax发布大数据时无响应的行为 [英] Unresponsive behavior while posting large data through ajax

查看:110
本文介绍了通过ajax发布大数据时无响应的行为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图通过ajax将大量对象大约(20,000条记录)发布到mvc(5)控制器。当我点击发送按钮时,浏览器显示无响应的行为。



我确实把调试mvc控制器,请求没有发送到服务器,它正在被绞死/超时在客户端。



I am trying to post large array of object approx (20,000 record) through ajax to a mvc (5) controller. When i click send button, the browser shows unresponsive behavior.

I did put debug mvc controller, the request is not send to server and it is getting hanged/time out at client side.

$.ajax(MyController/SendMessage, {
            type: POST;,
            dataType: json;,
            data: $.toDictionary({
                recipients: selecteditems  // array of object : 20,000 items
            })
        })





我有什么尝试过:



我不知道在这里尝试什么,因为它看起来非常简单。但是我打开了一个空的mvc应用程序并通过它在那里发布大型数组。但是不能在我的实际应用程序中工作。



What I have tried:

I have not clue what to try here, as it looks very simple. However i opened an empty mvc application and posted large array through it works there. However not working in my actual app.

推荐答案

.ajax(MyController / SendMessage,{
类型:POST;,
dataType:json; ,
数据:
.ajax(MyController/SendMessage, { type: POST;, dataType: json;, data:


.toDictionary({
收件人:selecteditems // 对象数组:20,000个项目
})
})
.toDictionary({ recipients: selecteditems // array of object : 20,000 items }) })





我尝试了什么:



我不知道在这里尝试什么,因为它看起来非常简单。但是我打开了一个空的mvc应用程序并通过它在那里发布大型数组。但是在我的实际应用程序中无效。



What I have tried:

I have not clue what to try here, as it looks very simple. However i opened an empty mvc application and posted large array through it works there. However not working in my actual app.


这篇关于通过ajax发布大数据时无响应的行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆