Ajax发布数据maxJsonLength属性限制已超出 [英] Ajax Post Data maxJsonLength property limit execeeded

查看:49
本文介绍了Ajax发布数据maxJsonLength属性限制已超出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我在ajax请求中发布大量数据时遇到问题



检查以下代码

Hi,

I am having problem while post large amount of data in ajax request

Check Below Code

var jsonPostData = {
    p_HTML: $("#div").html(),
    p_FromDate: $("#dpFrom").val(),
    p_ToDate: $("#dpTo").val()
}
$.ajax({
    url: "url",
    contentType: "application/json; charset=utf-8",
    type: "post",
    dataType: "json",
    data: JSON.stringify(jsonPostData),
    success: function (result) {
                },
    error: function (a, b, c) {
    }
});





Ajax Post将数据发送到控制器方法

喜欢/ Conroller / Method /

我在web.confige中添加了jsonSerialization但它不起作用



我也试过



The Ajax Post will Send data to controller method
like /Conroller/Method/
I Add jsonSerialization in web.confige but its not working

I also tried

<appSettings>
<add key="maxJsonLength" value="52428800" />
</appSettings>





但不工作



我收到错误



使用JSON JavaScriptSerializer进行序列化或反序列化时出错。字符串的长度超过了maxJsonLength属性上设置的值。

参数名称:输入



请求标题类似





but not working

I am getting error

Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property.
Parameter name: input

Request header something like

Accept  application/json, text/javascript, */*; q=0.01
Accept-Encoding gzip, deflate
Accept-Language en-US,en;q=0.5
Content-Length  3566924
Content-Type    application/json; charset=utf-8



.................


.................

推荐答案

#div)。html(),
p_FromDate:
("#div").html(), p_FromDate:


#dpFrom)。val (),
p_ToDate:
("#dpFrom").val(), p_ToDate:


#dpTo)。val()
}
("#dpTo").val() }


这篇关于Ajax发布数据maxJsonLength属性限制已超出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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