1.js填充数据
1 function SetTempDetailModulValue() { 2 var tr = $("#dataTempDatialTable tbody tr"); 3 var data = []; 4 for(var i=0;i<tr.length;i++) { 5 data.push($(tr[i]).find("td").eq(1).html());//模框ID 6 data.push($(tr[i]).find("td").eq(3).html());//模框DIV 7 data.push($(tr[i]).find("td").eq(6).find("select option:selected").val());//模块ID 8 } 9 $("#hidTempDatailTable").val(data.join(",")); 10 }
2.后台取值
1 string[] datas = Request.Form["hidTempDatailTable"].Trim().Split(','); 2 3 int i = 0, tempDetailID = 0, moduleID = 0; 4 while (i < datas.Length) 5 { 6 string tdId = datas[i]; 7 string divId = datas[i + 1]; 8 string mId = datas[i + 2]; 9 int.TryParse(tdId, out tempDetailID); 10 int.TryParse(mId, out moduleID); 11 utm.TempDetailD = tempDetailID; 12 utm.DivID = divId; 13 utm.ModuleID = moduleID; 14 count = T_COM_UserTempModuleBll.Instance.Add(utm); 15 i += 3; 16 }