¿Hay algún límite para el tamaño de datos POST en Ajax?

Estoy intentando enviar una serie de datos desde mi página a la Acción MVC usando jQuery Ajax. Aquí está mi código jQuery:

$('#btnSave').click(
  function () {
    result = [];
    $('#tblMatters tbody tr.mattersRow').each(function () {
      if (!($(this).hasClass('warning'))) {
        var item = {};
        if ($(this).find('td.qbmatter > div.dropdown').length > 0) {
          item.QBDescription = $(this).find('td.qbmatter > div.dropdown > a').text();
        } else {
          item.QBDescription = $(this).find('td.qbmatter').text();
        }
        var id = $(this).find("td:first > a").text();
        item.Narrative = $("#collapse" + id).find("div.scrollCell").text();
        item.WorkDate = $(this).find('td.workDate').text();
        item.Hours = $(this).find('td.hours').text();
        item.Person = $(this).find('td.person').text();
        if ($(this).find('td.rate > div.dropdown').length > 0) {
          item.Rate = $(this).find('td.rate > div.dropdown > a').text();
        } else {
          item.Rate = $(this).find('td.rate').text();
        }
        item.Amount = $(this).find('td.amount').text();
        result.push(item);
      }
    });
    var originalRecords = $("#tblSummary tr.summaryTotalRow td.summaryOriginalRecords").text();
    var originalHours = $("#tblSummary tr.summaryTotalRow td.summaryOriginalHours").text();
    var excludedHours = $("#tblSummary tr.summaryTotalRow td.summaryExcludedHours").text();
    var totalHours = $("#tblSummary tr.summaryTotalRow td.summaryTotalHours").text();
    $.ajax({
      url: "/Home/SaveQBMatter",
      type: "POST",
      data: JSON.stringify({ 'Matters': result, 'originalRecords': originalRecords, 'originalHours': originalHours, 'excludedHours': excludedHours, 'totalHours': totalHours }),
      dataType: "json",
      traditional: true,
      contentType: "application/json; charset=utf-8",
      success: function (data) {
        if (data.status == "Success") {
          alert("Success!");
          var url = '@Url.Action("Index", "Home")';
          window.location.href = url;
        } else {
          alert("Error On the DB Level!");
        }
      },
      error: function () {
        alert("An error has occured!!!");
      }
    });
});

Déjame explicarte un poco. Tengo una tabla HTML que fue construida dinámicamente y necesito almacenar estos datos en una base de datos. En jQuery tengo un bucle que atraviesa la tabla y almaceno datos de cada fila en elresult formación. Luego paso estos datos usando Ajax en MVC Action.

Y aquí es donde comienza mi problema ... Me he dado cuenta de que a veces funciona como debería ser, pero a veces recibo un error de Ajax.alert("An error has occured!!!"); Ahora he entendido que este error ocurre cuando miresult La matriz se está haciendo grande. Por ejemplo: si contiene 100-150 elementos> todo está bien, pero cuando hay más de ~ 150> Error.

¿Hay algún límite POST en Ajax? ¿Cómo puedo configurarlo para cualquier tamaño? ¡Realmente necesito esta funcionalidad! Cualquier ayuda por favor!

Mi código de ActionResult:

public ActionResult SaveQBMatter(QBMatter[] Matters, string originalRecords, string originalHours, string excludedHours, string totalHours) {
  DBAccess dba = new DBAccess();
  int QBMatterID = 0;
  int exportedFileID = 0;
  foreach (QBMatter qb in Matters) {
    dba.InsertQBMatter(qb.QBDescription, qb.Narrative, qb.WorkDate, qb.Person, qb.Hours, qb.Rate, qb.Amount, ref QBMatterID);
  }
  ExcelTranslator translator = new ExcelTranslator();
  translator.CreateExcelFile("", Matters, originalRecords, originalHours, excludedHours, totalHours);
  return Json(new { status = "Success", message = "Passed" });
}

ACTUALIZACIÓN: Encontré una solución

¡JSON tiene una longitud máxima! Necesito aumentar este valor. En web.config agrega lo siguiente:

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

Respuestas a la pregunta(6)

Su respuesta a la pregunta