2013-10-12 75 views
0

您会在下面看到项目side.I要使用我的“数据”中的项目。通过使用Javascript发送多个数据到控制器json

就是这样。

MyItemList:项目

我怎样才能使用的数据项?

var items = checkListBox3.GetSelectedItems(); 
alert(Array.prototype.map.call(items, function (item) { 
return item.value; 
}).join(", ")); 

var data= { 
Something: Something.GetValue(), 
//My question here (I want to use above items here like MyList:items) 
}; 

$.ajax({ 
url: "/Home/MyUrl", 
type: "POST", 
dataType: "json", 
contentType: 'application/json', 
data: JSON.stringify(veri), 

回答

1

我会建议尝试正是在你的代码的评论称,并使用MyList:items

var data= { 
    Something : Something.GetValue(), 
    MyList : items 
}; 
相关问题