I get the following error when a jQuery Sort calls my sort action:
The parameter dictionary contains an invalid entry for the "DonationIDS" parameter for the "System.Web.Mvc.EmptyResult SortDonations (System.Collections.Generic.List 1[System.Int32])' in 'Vol.Web.Areas.ActivityArea.Controllers.DonationController'. The dictionary contains a value of type 'System.Collections.Generic.List1 [Vol.Models.Token]" method, but the parameter requires a value of the type "System.Collections.Generic .List`1 [System.Int32] ".
Parameter name: parameters
JQuery
$("#dlist").sortable({
handle: '.sorthandle',
update: function () {
var order = $('#dlist').sortable('toArray');
$.ajax({
url: '/activity/donation/sortdonations',
data: { DonationIDS: order },
type: 'POST',
traditional: true
});
}
});
Message Values:
Parametersapplication/x-www-form-urlencoded
DonationIDS 1
DonationIDS 8
Source
DonationIDS=1&DonationIDS=8
MVC action:
public EmptyResult SortDonations(List<int> DonationIDS)
{
int order = 0;
foreach (int i in DonationIDS)
{
donationRepository.UpdateSortOrder(i, order);
order++;
}
return new EmptyResult();
}
It worked fine, but now it seems to refer to another class, a token. Any ideas what is happening or where to start looking?
source
share