ASP.NET MVC and JQuery get info to controller

前端 未结 7 1404
轻奢々
轻奢々 2020-12-28 23:51

I am totally confused on how to do ajax stuffs with jQuery and it seems the more I try the more confused I get. At this point all I want to do is get data to my controller

7条回答
  •  庸人自扰
    2020-12-29 00:01

    Use a tool such as firebug to make sure that the url you expect is being called.

    Debugging routine =>

    1. Use Firbug to determine that the correct url is being called and the correct data is being sent in the post
    2. Break the call in the action and make sure the parameters are being populated correctly
    3. Use Firebug again to check the response

    IE developer Toolbar can also be used instead of Firebug if you prefer IE. if the call url and post data seem correct, and the action isn't being called you should check your routing rules. ie does it have any default values in which case the MVC framework will be looking for a method signature that contains those default values (do you have {id} in your url rule?)

提交回复
热议问题