我要把所有数据输入一个有请求的物体。
This data are get into my controller with a function. In the headers of my data I have this information:
I have 4 objects allPly create but all data(gramme,lotion and others) equals null or zero. But the data comment and OtherData it s ok, this works.
感谢您的帮助
我请求:
var params={};
var allStep21 ={allData..}
$.extend(params,allStep21);
$.ajax({
type: "POST",
url: "Request",
data: params,
});
In the headers html:
allPly[0][Gramme]:10
allPly[0][Toto]:White
allPly[0][Test]:None
allPly[0][Lotion]:1
allPly[1][Grammage]:11
allPly[1][Toto]:White
allPly[1][Test]:Fine
allPly[1][Lotion]:0
OtherData : 585
Comment: all it s ok
在我的控制员中:
[HttpPost]
public ActionResult Request(AllStep21 allStep21)
{
}
In my model:
public class AllStep21
{
public String OtherData { get; set; }
public String Comment { get; set; }
public List<allPly> allPly { get; set; }
}
public class allPly
{
public int Gramme { get; set; }
public String Toto { get; set; }
public String Test { get; set; }
public int Lotion { get; set; }
}