Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

140
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda