簡體   English   中英

Angular JS 500內部服務器錯誤

[英]Angular JS 500 Internal Server error

我一直在嘗試解決此問題,但無法解決。 單擊此按鈕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 }
            );
        }
    }
}

最后,找到解決方案。 AngularJS不會引發特定錯誤。 我們還需要更新所有相關文件夾和Bin文件夾中的所有文件。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM