I'm having some problems passing an integer array to an MVC controller.
I'm grabbing my values as follows:
$checkedItems = $(':checked');
My ajax post is formatted like this:
$.ajax({
url: '/Items/MarkUnsuitable',
type: 'POST',
traditional: true,
data: { checkedRecords: $checkedItems, deletionReason: reason, deletionDescription: description },
error: function (xhr, ajaxOptions, thrownError) {
alert('An error occured when processing this request:\r\n\r\n' + thrownError);
},
My controller is receiving the data like this. The only missing value is the int[]
public ActionResult MarkUnsuitable(int[] checkedRecords, int? deletionReason, string deletionDescription)
Could anybody assist me with this problem?