Я пытаюсь отправить массив идентификаторов на сторону сервера (контроллера) из представления бритвы MVC, но когда число идентификаторов превышает 2000 в качестве длины строки запроса, я получаю следующую ошибку, и процесс останавливается.
Я пытался отправить данные, используя метод POST, но я получил ошибку.Последний снимок экрана - это ошибка, которую я получил, используя метод POST.

Я вставил сюда свою серверную часть и код Jquery.
Код серверной стороны 
КОД JQUERY
Процесс 1: Обычный метод

Процесс 2: Альтернативный метод отправки данных с использованием метода POST 

public void ExportPageStatusHistory(string[] PrescriptionIds)
{
ExcelPackage excel = new ExcelPackage();
var fileName = "PageStatusHistoryReport_" + DateTime.Now.ToStr();
var workSheet = excel.Workbook.Worksheets.Add(fileName);
var lst = string.Join(",", PrescriptionIds);
var result = PharmacyReferralService.GetPageASPNHistory(lst);
if (result.Count > 0)
{
workSheet.Cells[1, 1].LoadFromCollection(result, true);
workSheet.Cells.AutoFitColumns();
workSheet.Cells["A1:Z1"].Style.Font.Bold = true;
workSheet.Column(6).Width = 35;
workSheet.Column(7).Width = 35;
using (ExcelRange col = workSheet.Cells[2, 6, 1 + result.Count, 6])
{
col.Style.Numberformat.Format = "yyyy-MM-dd hh:mm AM/PM";
col.Style.HorizontalAlignment = ExcelHorizontalAlignment.Center;
}
using (ExcelRange col = workSheet.Cells[2, 7, 1 + result.Count, 7])
{
col.Style.Numberformat.Format = "yyyy-MM-dd hh:mm AM/PM";
col.Style.HorizontalAlignment = ExcelHorizontalAlignment.Center;
}
using (var memoryStream = new MemoryStream())
{
Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
Response.AddHeader("content-disposition", "attachment; filename=" + fileName + ".xlsx");
excel.SaveAs(memoryStream);
memoryStream.WriteTo(Response.OutputStream);
Response.Flush();
Response.End();
}
}
}
Jquery Code:
function ExportPrescriptionStatusHistory() {
$('#tbl_PrescriptionsDrugReport tbody tr td:nth-child(1)').each(function () {
items.push($(this).find("a").attr("data-id"));
});
@*var url = '@Url.Action("ExportPageStatusHistory", "Common")?PrescriptionIds=' + items;
location.href = url;*@
var url = '@Url.Action("ExportPageStatusHistory", "Common")';
$.ajax({
url: url,
type: "POST",
data: { PrescriptionIds: items },
async: false,
success: function(response){
},
error:function(xhr, ajaxOptions, thrownError)
{
alert(xhr.responseText);
ShowMessage("Error", "fail");
}
});
}