骨干模型dstroy功能不起作用 [英] Backbone model dstroy funtion doesn't work

查看:60
本文介绍了骨干模型dstroy功能不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用backbone.js.我有一个骨干模型。我只想简单地调用destroy函数来调用控制器中的delete方法(asp.net MVC)。删除调用发生但我为模型设置的值没有传递给控制器​​。有人可以建议我调用destroy函数吗?

i am using backbone.js.I have a backbone model. I just want to simply call the destroy function to call the delete method in controller(asp.net MVC). The delete call occurs but the values that i set for the model doesn''t pass to the controller. Can somebody suggest me a solution for calling the destroy function??

推荐答案

使用IE9 Developer工具栏或Fiddler查看从浏览器传递到服务器的内容。您可以在服务器端代码中设置断点,以查看请求中的内容。我不知道backbonejs api是如何格式化字段的,但要注意,它正在发出DELETE http请求,而不是post或get(所以,两个iis,并且必须准备好处理它的动作)。在找到字段在请求正文中的传递方式后,您可以相应地调整操作参数列表。
Use IE9 Developer toolbar or Fiddler to see what is passed from the browser to the server. You can set a breakpoint in server side code to see, what you have in the request. I don''t know how backbonejs api is formatting the fields, but be aware, that it is making a DELETE http request, not post or get (so, both iis, and the action has to be prepared to handle it). After you have found how the fields are passed in the request body, you can shape your action parameter list accordingly.


这篇关于骨干模型dstroy功能不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆