2

I am calling a method in MVC controller using $.post. i am passing an array of object to the controller using post method. when the length of the array exceeds certain number, i think aroung 136 the method in MVC controller is not getting called. i am not getting any error as well. so can anyone please provide me a solution for it. i have attached the sample code below

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

thanks in advance

5
  • You need to do some basic troubleshooting and provide more information than this. If you don't get error then why do you think problem exists with the $http post?
    – charlietfl
    Commented Feb 26, 2016 at 14:28
  • Try increasing the size of maxAllowedContentLength in Web.config. msdn.microsoft.com/en-us/library/ms689462%28VS.90%29.aspx Commented Feb 26, 2016 at 17:29
  • @charlietfl i placed debugger in both angularJS side and in the MVC controller , the method in MVC controller is not getting called, In angularJS it is executing without any error, how do you want me to find out what the error is. thanks in advance Commented Feb 28, 2016 at 2:05
  • How do you know it's not being called? Inspect actual request in browser dev tools network and see what status is, what is sent, received etc.
    – charlietfl
    Commented Feb 28, 2016 at 2:15
  • i found the solution adding <add key="aspnet:MaxJsonDeserializerMembers" value="150000" /> to the webconfig fixed the issue. thanks Commented Feb 29, 2016 at 9:25

1 Answer 1

2

adding to webconfig the following lines fixed the problem.

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.