ASP.NET MVC and JQuery get info to controller

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

    Ok, try this code using Ajax to pass data to your action method:

    jQuery.ajax({
                url: '@Url.Action("AddLink", "User")',
                type: 'POST',
                contentType: 'application/json',
                data: JSON.stringify({ title: title, url: url }),
                success: function (result) { }
            });
    
    0 讨论(0)
提交回复
热议问题