.Net Core post传值方式

时间:2020-06-06 10:51:32   收藏:0   阅读:139
$(#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("添加失败");
                }
            }
        });
    });

 

原文:https://www.cnblogs.com/lina0621/p/13053389.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!