angularjs - 无法在 AngularJS 中使用 $.post 调用 MVC Controller 方法以获取更大的数据

标签 angularjs asp.net-mvc post

我正在使用 $.post 调用 MVC Controller 中的方法。我使用 post 方法将一个对象数组传递给 Controller ​​。 当数组的长度超过一定数量时,我认为大约 136 MVC Controller 中的方法不会被调用。我也没有收到任何错误。 那么任何人都可以为我提供解决方案吗? 我已附上下面的示例代码

     $http.post('Controller/Method', {
                data: CollectionOfObject
            }).
           success(function (data, status, headers, config) {
              alert("success");                       
           }).
           error(function (data, status, headers, config) {
              alert("error");
           });

提前致谢

最佳答案

将以下行添加到 webconfig 解决了问题。

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

关于angularjs - 无法在 AngularJS 中使用 $.post 调用 MVC Controller 方法以获取更大的数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35654144/

相关文章:

php - 将其中包含引号的字符串作为不带反斜杠的 post 方法发送

javascript - AngularJs - 在指令中使用带有 ng-bind 的过滤器

angularjs - 如何在 angularjs 中发送具有多个参数的 POST?

c# - 如何将用户复选框检查写入数据库中的多条记录 - 使用 MVC、C#、Razor、nHibernate

c# - 使用NLog获取Application_Start()中的错误并重定向到友好页面错误

javascript - 如何在 Bootstrap 模式中提交提交数据?

angularjs - 如何在angularjs中切换按钮状态?

AngularJS - jQueryUI slider 值对模型的反射

asp.net-mvc - 如何创建强类型 BeginForm?

iphone - 用希伯来语将 JSON 从 iPhone 发送到 IIS,字符串在结尾前被剪切