I was trying to send array with the form data to an action with Ajax request but whenever I do I receive both the form data and the array empty
$scope.SubmitForm = function () {
var sLangs = $("#supportedLanguages").data("kendoMultiSelect").value();
var formdata = new FormData($('#frmAppSettings').get(0));
alert(formdata.SelectedLanguages);
var data = new FormData(document.getElementById("frmAppSettings"));
$.ajax({
type: "POST",
url: "/AppMenuMaker/AppSettings",
data: JSON.stringify({ AppSettingsView: formdata, SelectedLangs: sLangs }),
processData: false,
contentType: false,
success: function () {
}
});
}`
I have my action as following
[HttpPost]
[Authorize]
public ActionResult AppSettings( ApplicationSettingsViewModel AppSettingsView, int[] SelectedLangs)
{
}
Any help ?