I'm trying to pass a list of orderlines to a async controller action using Javascript:
var model = "<some JSON string>";
$.ajax({ type: "POST",
url: "/MyController/MyAction",
datatype: "json",
data: { 'orderLines': model},
success: function(msg) {
...
}
});
When I check the model variable in runtime, the values of the orderline properties are set ok. But when I put a breakpoint in my controller action, the properties of the orderline incoming parameter are 0. It looks like the JSON string wasn't properly deserialized.
The controller action looks like this:
public ActionResult AsyncUpdateOrderline(List<OrderLine> orderLines)
{
...
}
How can I correctly pass a complex object to a async controller action?
Thanks, Nils