Submit json to MVC3 action

前端 未结 2 1532
借酒劲吻你
借酒劲吻你 2020-12-25 10:18

I have a form created with Knockout.js. When the user presses the submit button, I convert the viewmodel back in a model and am trying to submit to the server. I tried:

2条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-25 11:05

    Also, it's in the example mentioned, but you may need to alter your JavaScript call to something like:

    ko.utils.postJson(location.href, { viewModel: this.viewModel });
    

提交回复
热议问题