javascript\\jQuery:
var items = new Array();
var obj { Begin: \"444\", End: \"end\" };
items.push(obj);
items.push(obj);
var request = {
Try write code as below:
var option = {
url: '/Home/Index',
type: 'POST',
data: JSON.stringify(request),
dataType: 'html',
contentType: 'application/json',
success: function(result) {
alert(result);
}
};
$.ajax(option);
U can't pass mass: items
and expect it to be serialized as a JSON array automatically, you will need to either iterate and construct the JSON (bad plan) or use a JSON library(good plan)