title: jquery ajax is not returning back to success function from MVC Controller
body: <p>I'm hitting a method in controller from <code>jquery ajax</code>. I have an <code>html</code> page outside the application from where I'm calling this method.</p>
  
  <p>Below is the <code>ajax</code> code written on <code>html</code> page.</p>
  
  <pre><code>function SignIn() {
          var d = JSON.stringify({
              Email: $('#email').val(),
              Password: $('#password').val()
          });
  
          $.ajax({
              url: "http://localhost:58954/Account/SignIn",
              type: "POST",
              contentType: "application/json; charset=utf-8",
              dataType: "JSON",
              data: d,
              success: function (e) {
                  alert('success');
  
              },
              error: function (e) {
                  alert(JSON.stringify(e));
              }
          });
      }
  </code></pre>
  
  <p>Below is the code written in <code>controller's</code> method. I'm returning <code>Json object</code> from here.</p>
  
  <pre><code>[AjaxOnly(), HttpPost(), AllowAnonymous()]
      public ActionResult SignIn(AuthenticationModel model)
      {
  
       // here code written for authentication 
  
        dynamic jsonData = new {
              Message = errorMessage,
              HasError = HasError,
              RedirectUrl = redirectUrl
          };
  
          return Json(jsonData);
      }
  </code></pre>
  
  <p>When ajax code run then it first goes to error function and shows me following details in alert.</p>
  
  <p><a href="https://i.stack.imgur.com/V5cNo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/V5cNo.png" alt="enter image description here"></a></p>
  
  <p>After this it hits the method in <code>controller</code> and <code>code</code> runs perfectly as it should and after that it doesn't return back to ajax call's success function.</p>
  
  <p>It shows the <code>Json object</code> on page as below:</p>
  
  <p><a href="https://i.stack.imgur.com/Ee8dG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ee8dG.png" alt=""></a></p>