I have a view with a form with a lot information like a table and each row is a new item.
I do an Ajax to send this list to Controller
This cont
are the each row of my view.
function salvarDerivacoes(cont) {
var arrayItems= [];
for (var i = 0; i <= cont; i++) {
arrayItems[i] = {
ID: parseInt(i),
Number: $(".number_" + i).text(),
S1: parseInt($(".s1_" + i).val()),
S2: parseInt($(".s2_" + i).val()),
S3: parseInt($(".s3_" + i).val()),
S4: parseInt($(".s4_" + i).val()),
S5: parseInt($(".s5_" + i).val()),
S6: parseInt($(".s6_" + i).val()),
S7: parseInt($(".s7_" + i).val()),
S8: parseInt($(".s8_" + i).val()),
S9: parseInt($(".s9_" + i).val()),
S10: parseInt($(".s10_" + i).val())
}
}
$.ajax({
url: "Save",
type: 'POST',
contentType: "application/json; charset=utf-8",
dataType: "json",
cache: false,
data: JSON.stringify({ json: arrayItems })
})
}
[HttpPost]
public ActionResult Save(List<MyObject> json)
{
}
But, when I have a many rows (above +/- 30), it never call my Controller, when I have below +/- 15 items, it work.
What is the problem? or How can i do this better?
Have this 2 to:
Failed to load resource: the server responded with a status of 404 (Not Found) POST http://localhost/Page/Save 500 (Internal Server Error)