2013-10-12 136 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 
}; 
相關問題