.Net Core post传值方式

$('#save').click(function () {
        var obj = {
            "Name": $('#txt_Name').val(),
            "JinE": $('#txt_JinE').val(),
            "ShouYi": $('#txt_ShouYi').val()
        };
        $.ajax({
            url: 'http://localhost:60054/product/insert',
            type: 'post',
            data: obj,
            dataType: 'json',
            contentType: 'application/x-www-form-urlencoded',
            accepts: "application/x-www-form-urlencoded",
            success: function (data) {
                if (data > 0) {
                    alert("添加成功");
                }
                else {
                    alert("添加失败");
                }
            }
        });
    });

 

posted @ 2020-06-06 08:35  CuiJie0605  阅读(703)  评论(0编辑  收藏  举报