How to send a model in jQuery $.ajax() post request to MVC controller method

前端 未结 7 1844
南方客
南方客 2020-11-27 02:47

In doing an auto-refresh using the following code, I assumed that when I do a post, the model will automatically sent to the controller:

$.ajax({
    url: \'         


        
7条回答
  •  无人及你
    2020-11-27 03:14

    I think you need to explicitly pass the data attribute. One way to do this is to use the data = $('#your-form-id').serialize();

    This post may be helpful. Post with jquery and ajax

    Have a look at the doc here.. Ajax serialize

提交回复
热议问题