I have a javascript object like:
var data={
Manager:name,
ID:id,
EmployeeNames:arrayEmployees
};
As you can see, name and id are simple strings but EmployeeNames is an array object. I have the ajax call like this:
$.ajax({
type: "POST",
url: "GetManagerEmployees",
content: "application/json;",
dataType: "json",
data: data,
success:
error:
});
In the controller I have a method GetManagerEmployees(Data data) with parameter of type Data which contains all the properties:
public class Data
{
public string Manager { get; set; }
public int id { get; set; }
public List<string> EmployeeNames { get; set; }
I'm getting data.EmployeeNames as null in my controller, what am I doing wrong here? Can you please help me on this?