Passing A List Of Objects Into An ActionResult MVC Controller Method Using jQuery Ajax
ajax, asp.net-mvc, asp.net-mvc-4, c#, jquery
Solution
I think first of all your JSON should be strongly typed. and once it already strongly typed you need not use JSON.stringfy. instead go with,
data: {"things" : things},
and your controller should be like
public IActionResult ActionName(List<Model> things)
Problem
possible duplicate Passing A List Of Objects Into An MVC Controller Method Using jQuery Ajax but my question is when I pass ``` var things = [ {employee:'test',effectiveDate:'',expirationDate:'' }, { employee:'test',effectiveDate:'',expirationDate:'' } ]; $.ajax({ contentType: 'application/json', type: "POST", url: "/MyController/CheckMethod", dataType: "json", data: JSON.stringify(things), async: false, success: function (data) { ``` to an controller method which is a `[HTTPPOPST] JsonResult` then I'm getting `value` into my `List<MYMODEL>` but when I take a controller method as `'ActionResult'` then i'm getting `null` in `List<MYMODEL>` why so any thing wrong?