asp.net - jQuery 发布到 asp.net 页面错误 : The length of the query string for this request exceeds the configured maxQueryStringLength value

标签 asp.net post jquery query-string

我正在尝试使用 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&ltxt=" + 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/

相关文章:

c# - 如何在同一个 Visual Studio 解决方案中设置 ASP Classic 和 ASP.NET WebForm - 用于在 ASP.NET WebForm 中重写 ASP Classic 页面

css - 如何使用 CSS 在 ASP.NET 中设置文本框和标签的样式

asp.net - 你能确定你的网络表单页面遵循的路线名称吗?

mysql - WordPress 以任意顺序获取特定帖子

jquery - 如何在移动网络应用程序的横向锁定 ipad 方向

asp.net - MVC3 : Route with same name as directory

HTTP POST : content-length header required?

php - 需要保存两次提交的 $_POST 数据

页面中的Jquery多个幻灯片复选框

javascript - 检查 PHP/jQuery 中哪些表单字段已更新