【问题标题】:jQuery post to asp.net page error : The length of the query string for this request exceeds the configured maxQueryStringLength valuejQuery post to asp.net page error : The length of the query string for this request超出了配置的maxQueryStringLength值
【发布时间】:2010-10-12 16:02:00
【问题描述】:

我正在尝试从我的 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 post jquery query-string


    【解决方案1】:

    这是 ASP.net 4.0 吗?如果那么你可以像这样设置maxQueryStringLength

    <httpRuntime maxRequestPathLength="360" maxQueryStringLength="1024" /> 
    

    【讨论】:

      猜你喜欢
      • 2022-12-01
      • 2022-12-26
      • 2021-11-14
      • 2023-02-01
      • 2019-02-18
      • 2022-11-20
      • 2022-12-02
      • 2020-12-23
      • 2022-12-01
      相关资源
      最近更新 更多