如何使用asp.net api使用angular js前端将页面重定向到另一个页面时如何传递请求

时间:2019-03-05 14:39:01

标签: asp.net angularjs

var app = angular.module('myApp2', []);
app.controller('myCtrl2', function($scope, $http,$window)
{
    $scope.getLogdetails = function (postCredential) {

        //alert("hello check data");
        $http({
            method: 'Post',
            url:'https://localhost:44339/Signs/datacheck',
            data: $scope.postdata,
            params: { username: $scope.username, password: $scope.password }
        }).then(function mysucess(response) {
            console.log(response, "response");
            if (response.data =="true")
            {
                //console.log("save")
                //console.log(response.data,"sar");

                window.location = '/homepage.html?username=' + name;
                //console.log(response.data,"");

            } else {
                alert("username name passords incorect");
            }

        })
    }
});

这是我的js文件                     。 出现屏幕上显示的错误enter image description here镜头

0 个答案:

没有答案
相关问题