0
我一直在試圖解決這個問題,但無法。點擊這個按鈕btnVerifyWhoYouAre我得到這500內部服務器錯誤。我在這裏做錯了什麼?Angular JS 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 }
);
}
}
}