【发布时间】:2010-12-21 02:51:21
【问题描述】:
当 JQuery Sort 调用我的排序操作时,我收到以下错误:
参数字典包含方法“System.Web.Mvc.EmptyResult SortDonations(System.Collections.Generic.List1[System.Int32])' in 'Vol.Web.Areas.ActivityArea.Controllers.DonationController'. The dictionary contains a value of type 'System.Collections.Generic.List1[Vol.Models.Token]”的参数“DonationIDS”的无效条目,但参数需要“System.Collections.Generic.List`1[System.Int32]”类型的值。
参数名称:参数
jQuery:
$("#dlist").sortable({
handle: '.sorthandle',
update: function () {
var order = $('#dlist').sortable('toArray');
$.ajax({
url: '/activity/donation/sortdonations',
data: { DonationIDS: order },
type: 'POST',
traditional: true
});
}
});
发布价值观:
Parametersapplication/x-www-form-urlencoded
DonationIDS 1
DonationIDS 8
Source
DonationIDS=1&DonationIDS=8
MVC 动作:
public EmptyResult SortDonations(List<int> DonationIDS)
{
int order = 0;
foreach (int i in DonationIDS)
{
donationRepository.UpdateSortOrder(i, order);
order++;
}
return new EmptyResult();
}
它工作得很好,但现在它似乎引用了另一个类,Token。任何想法发生了什么或从哪里开始寻找?
【问题讨论】:
标签: jquery asp.net-mvc jquery-ui-sortable