Asp.net web api 剑道格网发布和删除发送空到控制器

Asp.net web api 剑道格网发布和删除发送空到控制器,asp.net-web-api,kendo-ui,kendo-grid,Asp.net Web Api,Kendo Ui,Kendo Grid,我发布了一个kendoui网络网格,它没有发送数据,我看不出我所做的与失败的有什么不同。我正在发布到控制器,但它不是空的(如果batch:true,则为空;如果batch:false,则为空) web api: public Certification DeleteCertification(CertificationVm cert) { var model = Uow.Certifications.Get(cert.Id); i

我发布了一个kendoui网络网格,它没有发送数据,我看不出我所做的与失败的有什么不同。我正在发布到控制器,但它不是空的(如果batch:true,则为空;如果batch:false,则为空)

web api:

 public Certification DeleteCertification(CertificationVm cert)
        {
            var model = Uow.Certifications.Get(cert.Id);
            if (model == null)
                throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.NoContent));
            Uow.Certifications.Delete(model);
            Uow.Commit();
            return model;
        }

不存在jsonp+POST这样的东西——我们已经讨论过了。
除非您真的知道为什么需要jsonp,否则不要使用它。

我已经找到了它,尽管我不得不离开这个例子

修复方法是添加内容类型,正确使用数据类型:“json”,如上所述,从batch:true更改为batch:false,并将参数映射更改为以下内容

 destroy: {
                                    url: crudServiceBaseUrl,
                                    type: "Delete",
                                    contentType: "application/json; charset=utf-8",
                                    dataType: "json"
                                },



parameterMap: function (model, operation) {
                                    if (operation !== "read" && model) {
                                        return  kendo.stringify(model) ;
                                    }
                                }

很好的理解,您是非常正确的,我已经纠正了我的示例,但是delete方法配置正确。在我离开后,我确实找到了答案。然而,这不是答案。我会在下面贴出正确的答案。很可能你的问题是,你可以在那里找到帮助
 destroy: {
                                    url: crudServiceBaseUrl,
                                    type: "Delete",
                                    contentType: "application/json; charset=utf-8",
                                    dataType: "json"
                                },



parameterMap: function (model, operation) {
                                    if (operation !== "read" && model) {
                                        return  kendo.stringify(model) ;
                                    }
                                }