我正在尝试使用 jQuery 将文本编辑器的内容从我的 javascript 发布到 asp.net 页面 (asp.net 4.0)。asp.net 页面将接收它并将其保存到 db。我附加查询字符串中文本编辑器的内容。当内容很大时,我收到以下异常
The length of the query string for this request exceeds the configured maxQueryStringLength value.
对于小内容它工作得很好。但是当内容很大时,它会抛出错误
这是我的 JavaScript 代码
var content1 = $("#txtAdminLabelEdit"+id).val();
content = encodeURIComponent(content1);
var url = "handlers/adminhandler.aspx?mode=savecontent&page=home&lid=1&vid=2<xt=" + content;
$.post(url, function (data) {
if (data == "yes") {
//do something
}
});
最佳答案
这是 ASP.net 4.0 吗?如果那么你可以像这样设置maxQueryStringLength
。
<httpRuntime maxRequestPathLength="360" maxQueryStringLength="1024" />
关于asp.net - jQuery 发布到 asp.net 页面错误 : The length of the query string for this request exceeds the configured maxQueryStringLength value,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3916660/