title: Angular JS 500 Internal Server error
body: <p>I've been trying to solve this issue but unable to. On a click of this button btnVerifyWhoYouAre I get this 500 internal server error. Am I doing something wrong here?</p>
  
  <p>This is my Angularjs file:</p>
  
  <pre><code>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);
              });
  
      };
  </code></pre>
  
  <p>This is my routing file</p>
  
  <pre><code>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 }
              );
          }
      }
  }
  </code></pre>