I have the following json object, sorry for the image;
The jquery code I have looks like this;
var data = {
table: table,
favour: $("[name='radFavour']:checked").val(),
data: jsonObj
};
$.ajax({
url: appDomain + "/Compare/Ajax_Update",
type: "post",
dataType: "json",
data: data
});
The c# code looks like;
[HttpPost]
public void Ajax_Update(CompareFVM fvm)
{
}
The FVM contains a string for table and for favour and the data for those two properties comes through.
For "data" I have the following in the FVM;
public List<CompareItem> data { get; set; }
And the item;
public class CompareItem
{
public int prodId { get; set; }
public int stageId { get; set; }
public string value { get; set; }
public string property { get; set; }
}
The List has the correct amount of elements in it, in this case two, but each of them has nulls set.
So the data I am posting back is not coming through for the array elements but it is for the single fields.
Any ideas?