Angular JS 500内部服务器错误

时间:2017-02-21 21:15:34

标签: angularjs server internal

我一直试图解决这个问题,但无法解决。单击此按钮btnVerifyWhoYouAre我得到此500内部服务器错误。我在这里做错了吗?

这是我的Angularjs文件:

var myApp = angular.module('ValidateSecureEmailApp', ['ui.mask', 'ui.event', 'ui.validate'])
.config(['$httpProvider', function ($httpProvider) {
    $httpProvider.defaults.withCredentials = true;
}]);

// Config to on blur event still with the values
myApp.config(['uiMask.ConfigProvider', function (uiMaskConfigProvider) {
   uiMaskConfigProvider.clearOnBlur(false);
}]);

myApp.controller('ValidateController', ["$scope", "$http", "$window",  function ($scope, $http, $window) {

    $scope.sendForm = function () {

        $('#btnVerifyWhoYouAre').attr('disabled', true);
        $http(
            {
                method: 'POST',
                url: 'Index',
                data: { borrower: JSON.stringify($scope.borrower) }

            }
            ).then(function (response) {
                if (response.data == "Error") {
                    $scope.showfail = true;
                    $('#btnVerifyWhoYouAre').attr('disabled', false);
            } else {

                    if (response.data == "dr")
                    {
                        $window.location.href = '/DocumentUpload/Index'
                    }
                    if (response.data == "qs")
                    {
                        $window.location.href = '/Payment/Index'
                    }
                    if (response.data == "pc")
                    {
                        $window.location.href = '/ConsentDoc/Index'
                    }

                }     
            }, function (response) {
                $scope.showfail = true;
                $('#btnVerifyWhoYouAre').attr('disabled', false);
            });

    };

这是我的路由文件

namespace eMortgageApp
{
    public class RouteConfig
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            //routes.MapRoute(
            //    name: "DocUploadLogin",
            //    url: "{controller}/{action}/{pc}",
            //    defaults: new { controller = "DocUploadLogin", action = "Index", id=UrlParameter.Optional  }
            //);

            routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
            );
        }
    }
}

1 个答案:

答案 0 :(得分:0)

最后,找到了解决方案。 AngularJS不会抛出特定错误。我们还需要更新所有相关文件夹和Bin文件夹中的所有文件。