ASP.NET MVC and JQuery get info to controller

前端 未结 7 1418
轻奢々
轻奢々 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:04

    have you tried using the jQuery.post method should be something like

    jQuery.post("/User/AddLink",AjaxLink,function(data,textStatus)
    {
      if(textStatus=="success")
      {
        //do something with data which is the result from the call}
      }
      else
      {
      //failed somewhere along the line
      }
    },"json");
    

    post values are mapped to parameters in the MVC call so foxxtrot's code should be unnecessary.

提交回复
热议问题