I have the following AJAX call to a controller action method:
$.ajax({
type: "POST",
url: "/BasesDados/Produtos/EditarProduto",
data: {
objProduto: objProduto,
listProdutoLinguas: produtoLinguas,
listCoresTamanhos: corTamanhos,
atributoIDs: attIDs
},
success: function (res) {
// ..do something
}
});
I am populating the objects within the script before calling the AJAX function. It works fine and sends the data to the controller, unless it has a big chunk of data to be sent. In a specific error case, the object 'corTamanhos' is populated with 261 elements (it's an array of objects), and in this particular case, the AJAX call fails, it never sends the request over to the server.
I've tried so many things like, JSON.serialize, using a formData element, I'm getting desperate.
After checking the console, I discovered the error is an Exception, as follows:
"InvalidDataException: Form value count limit 1024 exceeded."
How can I overcome this?
Anyone can help?
Thank you very much in advance.