ASP.NET MVC Passing model to controller with AJAX

前端 未结 1 459
庸人自扰
庸人自扰 2021-01-22 04:36

I\'m trying to pass a model to my controller with an ajax call.

I\'ve looked at the answer provided by Laviak in the following question but was not able to get it to wor

1条回答
  •  隐瞒了意图╮
    2021-01-22 04:59

    Make sure that the javascript file that is containing the AJAX call is included after the script that defines the MODEL variable in your master file:

    
    
    

    Also I would recommend you taking a look at the following article which illustrates how to pass complex object graphs using JSON AJAX request to a controller.

    0 讨论(0)
提交回复
热议问题