ajax调用mvc控制器

     function btnLogin_click() {

            $.ajax({

                type: "post",

                url:"/Home/LoginSystem",   //控制器路径

                data: "userAccount="+ $.trim($("#txtUserAccount").val()) + "&userPassWord="+ $.trim($("#txtUserPassWord").val()),   //参数

                cache: false,

                success: function (msg) {

                    if (msg == '1') {

                        location.href ='/Home/Index';

                    }

                    else {

                        alert(msg);

                    }

                }

            });

        }

转载于:https://my.oschina.net/dongri/blog/610903

猜你喜欢

转载自blog.csdn.net/weixin_33850015/article/details/91765851