Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

152
Visualizações
MVC Ajax array post method doesn't work

My problem is that when I post data with ajax with code below

 $.ajax({
                        type: 'POST',
                        url: '@Url.Action("ChangeOrder", "Menu")',
                        data: JSON.stringify(array),
                        success: function (data, status, xhr) {

                            if (data.Status == 200) {
                                toastr.success('@Resources.Resource.Success_MenuOrderSave');

                            }
                            else {
                                toastr.error('@Resources.Resource.Error_Unexpected');
                                return;
                            }
                        },
                        dataType: "json",
                        contentType: "application/json; charset=utf-8",
                        beforeSend: function () {

                        },
                        complete: function () {

                        }
                    });

It occurs error when send array that has 227 item in it, but it work if array has 10 items , Is there a limit for this ?

 var item = {
                            refMenu: data[i].id,
                            refParent: null,
                            refPortal: "@SessionRepository.GetPortalId()",
                            Order:i+1
                        }

array of item is above. Error is 500 it acts as get method when array is big. but it works when array is not big

Error is

Exception Details: System.InvalidOperationException: The JSON request was too large to be deserialized.

Thanks in advance

about 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

Try a bigger value for aspnet:MaxJsonDeserializerMembers in the web.config:

<appSettings>
  <add key="aspnet:MaxJsonDeserializerMembers" value="150000" />
</appSettings>
about 4 years ago · Santiago Trujillo Relatório

0

Set a higher max JSON value for aspnet:MaxJsonDeserializerMembers in the appSettings:

<appSettings>
  <add key="aspnet:MaxJsonDeserializerMembers" value="1000000" />
</appSettings>
about 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda