js傳送集合資料到後臺,後臺方法引數名用集合接收
阿新 • • 發佈:2019-01-27
//前臺表單
<form id="fm03" style="display:none">
<input id="CoalByTrainId" name="list[0].CoalByTrainId" value="4500" type="hidden" /><input id="BillWeight" name="list[0].BillWeight" value="70" type="hidden" />
<input id="CoalByTrainId" name="list[1].CoalByTrainId" value="4501" type="hidden" />
<input id="BillWeight" name="list[1].BillWeight" value="72" type="hidden" />
</form>
//後臺方法
public string SaveBillWeightList(List<CoalByTrain> list)
public class CoalByTrain{
//id
public string CoalByTrainId{get;set;}
//票重
public string BillWeight{get;set;}
}