I have tried like this but could not get array list. It returns \'null\'
var data=[];
data[0] = \'1\';
data[1] = \'2\';
$.ajax({
var datas = { data0: '1',
data1: '2' };
$.ajax({
url: '@Url.Action("AddFrequencyWeekly", "Plannar")',
type: "POST",
data: datas,
dataType: 'json',
success: function (data) {
alert("Record Updated Successfully");
}
});
Its the way you are expecting to recive the data in the action method, try
public JsonResult AddFrequencyWeekly(IEnumeable<string> data)
{
}