【问题标题】:how to increase size of post parameter list如何增加帖子参数列表的大小
【发布时间】:2018-10-04 21:32:26
【问题描述】:

Post 适用于长度为 20 的数组,但不适用于长度为 2000 的数组:

js/角度

  $http.post('/index/SaveArray', $scope.SaveList).then(
                function successCallback(response) {},
                function errorCallback(response) {}
  );

C#

  public ActionResult SaveArray(List<SelectModel> dataToSave)
  {
      StringBuilder str = new StringBuilder();
      JsonResult objResult = new JsonResult();
      return Json(objResult, JsonRequestBehavior.AllowGet);
  }

【问题讨论】:

    标签: angularjs asp.net-mvc asp.net-mvc-4 asp.net-web-api


    【解决方案1】:

    您可以将此键添加到 web.config 文件中的 App Setting 标签中。
    此设置增加了允许反序列化的元素。

     <appSettings>
            <add key="aspnet:MaxJsonDeserializerMembers" value="2147483644" />
     </appSettings>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-09-02
      • 2021-07-13
      • 1970-01-01
      • 2019-06-06
      • 2014-06-15
      • 1970-01-01
      • 2015-12-06
      相关资源
      最近更新 更多