转载http://www.cnblogs.com/luoyefeiwu/p/5776507.html,非常感谢该篇文章帮我解决了问题
1.前端请求如下
var apply = { CompanyName: $("[name='corpName']").val(),ContactUser: $("[name='contName']").val(),Address: $("[name='address']").val(),Mobile: $("[name='phone']").val(),MainProducts: $("[name='goods']").val(),Remark: $("[name='mark']").val(),IsMember: $("[name='Meber']:checked").val() }; var applyDetail = []; $('.Info').each(function (index,item) { //参会代表 var DelegateName = $(item).find("[name='Name']").val(); //性别 var Sex = $(item).find("[name='Sex']").val(); //职位 var Post = $(item).find("[name='Position']").val(); //手机 var Mobile = $(item).find("[name='Phone']").val(); //邮箱 var EMail = $(item).find("[name='Email']").val(); //会场 var SiteType = $(item).find("[name='SiteType']").val(); var detial = { DelegateName: DelegateName,Sex: Sex,Post: Post,Mobile: Mobile,EMail: EMail,SiteType: SiteType }; applyDetail.push(detial); }); var postData = { applyModel: apply,applyDetail: applyDetail }; $.ajax({ url: '/ActivityBusiness/Apply_From_Json?ApplyNo=@ViewBag.ApplyNo&SpeciaNo=@ViewBag.SpeciaNo',data: JSON.stringify(postData),dataType: 'json',contentType: 'application/json',type: "POST",// traditional: true,success: function (res) { if (res.Success) { tipDialog(res.Message,3,res.Code); top.frames[tabiframeId()].windowload(); closeDialog(); } else { tipDialog(res.Message,-1); } } });
2,注意事项
要设置 contentType: 'application/json'
3,效果 如下图