function test() { var stringArray = new Array(); stringArray[0] = "item1"; stringArray[1] = "item2"; stringArray[2] = "item3"; var postData = { values: stringArray }; $.ajax({ type: "POST", url: "/Home/SaveList", data: postData, success: function(data){ alert(data.Result); }, dataType: "json", traditional: true }); }
public JsonResult SaveList(List values) { return Json(new { Result = String.Format("Fist item in list: '{0}'", values[0]) }); }