firstly sorry for my bad english, my problem is, i have a controller that receive a list of object as param, but when i try sent this list to controller always receive null.
public async Task<ActionResult> MyAction(List<class> object)
{
//do stuff
}
my javascript
var array= []
array.push()...
document.location = '/MyAction/Controller?object'JSON.stringify(array)
my controller always receive null
i alreay tried use ajax, but for some reason ajax call my controler twice, in first call i recieve my list correctly, but in second receive null
var array =[]
array.push()//just example
$.ajax({
type: 'POST',
tradicional:true,
async:true,
url: '/controller/MyAction',
data: JSON.stringify({ 'object': array}),
contentType: 'application/json; charset=utf-8',
datatype: 'json',
success: function (result) {
//if succes then load my View passing array as param
document.location = '/controller/MyAction?object' + JSON.stringify(array) ;
},
error: function (result) {
}
});