var dataSource = new kendo.data.DataSource({ transport: { read: { url: "/Admin/ReadBizFixed", contentType: "application/json", type: "POST", dataType: "json" }, update:{ url: "/Admin/UpdateBizFixed", }, destroy: { }, create: { } }, batch: true, pageSize: 20, schema: { model: { id: "Code", fields: { PaperName: { validation: { required: true } }, Price: { type: "number", validation: { required: true, min: 1 } }, NumStart: { type: "number", validation: { required: true, min: 1 } }, NumEnd: { type: "number", validation: { required: true, min: 0 } }, PNum: { type: "number", validation: { required: true, min: 0 } }, LongSideLength: { type: "number", validation: { required: true, min: 0 } }, ShortSideLength: { type: "number", validation: { required: true, min: 0 } }, Height: { type: "number", validation: { required: true, min: 0 } }, Width: { type: "number", validation: { required: true, min: 0 } }, Thick: { type: "number", validation: { required: true, min: 0 } } } } } });
这是datasource的js代码,启用调试,在执行datasource 内update的时候,服务端代码可以触发断点,但是不知道怎么接收传递过去的参数
public void UpdateBizFixed() { string a = "a"; }
这是服务端的方法
求kendo大神指点一二
post方式json格式
调试看下request.params有没有传过来的json对象
类似Request.Params[0]或者 Request.Params["KEY"].ToString();
取出json,反序列成对象
fe非常感谢您提供的思路,这样写就能获取到数据了
public void UpdateBizFixed(List<BizFixed> models) { string a = "a"; }