c# - How do I post an object array to Controller like json data via ajax -


i have model like

[datacontract] public class module_shortcut_order {     [datamember]     public int module_id { get; set; }     [datamember]     public int line_order { get; set; }     [datamember]     public string user_id { get; set; }  } 

and have controller use model list like

public jsonresult sortupdate(list<module_shortcut_order> process)     {         ...processing...     } 

and have ajax script post model list

parms = { "process": [{ "module_id": "10", "line_order": "0", "user_id": "12354" },  { "module_id": "5", "line_order": "1", "user_id": "32154" }] };  $.ajax({     type: "post",     url: "../home/sortupdate",     datatype: "json",     data: parms,     success: function (data) {          ... ...      }  }); 

javascript works object array doesnt fill controler list modal when run model fill objects as array count properties 0 or null


Comments

Popular posts from this blog

angular - Is it possible to get native element for formControl? -

unity3d - Rotate an object to face an opposite direction -

javascript - Why jQuery Select box change event is now working? -