I have action Method like this :
[HttpPost]
public virtual JsonResult AddCombination(Dictionary<Guid,Guid> combinations)
{
return Json(new { result = false });
}
and I have script to send some data with jquery Ajax like this :
$(document).on('click', '#addcombination', function () {
var combinationarray = {};
$(".drpcombination").each(function () {
var id = $(this).attr('name');
var selected = $(this).find(':selected');
if ($(selected).val().trim().length > 0) {
combinationarray[id] = $(selected).val();
}
});
if (Object.keys(combinationarray).length > 0) {
$.ajax({
url: $('#url').data('addcombination'),
type: 'POST',
dataType: "json",
//data: {combinations:combinationarray},
data: combinationarray ,
success: function (data) {
alert('success');
},
error: function (response) {
}
});
}
});
always combinatios are null.
firebug Result like this :
I try some ways but cant get any result .