我正在尝试将javascript映射对象传递给控制器,但是控制器中接收到的内容为空
我的对象
var mymap =new Map();
mymap.set(0,{ "type": '333', "price": '122' ,"limit":0 })
mymap.set(1,{ "type": '222', "price": '333' ,"limit":0 })
ajax通话:
$.ajax({
url: "Index/getKategoryarray",
data: JSON.stringify( mymap ), traditional: true,
contentType: "application/json charset=utf-8",
});
控制器:
public void getKategoryarray( PriceKategory[] pkatg)
{
}
PriceKategory类:
public class PriceKategory
{
public string type { get; set; }
public int price { get; set; }
public int limit { get; set; }
}