title: Controller JsonResult method always return status code 200 (OK)
body: <p>I have a code block like this:</p>
  
  <pre><code>public class AccountController : Controller
  {
      [HttpPost]
      public JsonResult Check(LoginModel model){
          ...
          Response.StatusCode = (int)HttpStatusCode.Unauthorized;
          return Json( new { ErrorMessage = "..." } );
      }
  }
  </code></pre>
  
  <p>This logic I want to send status code 401 back to the client.</p>
  
  <p>In my frontend, I use the jquery ajax method to call this method.</p>
  
  <pre><code>$.ajax({
    ...
    success: function(data, textStatus, xhr){
    ...
    },
    error: function(xhr, textStatus, error){
    ...
    }
  });
  </code></pre>
  
  <p>However, the error callback can never be reached.</p>
  
  <p>I used postman to debug, and I found that no matter what I always receive 200(OK).</p>
  
  <p>Do you guys have any idea what's going on here?</p>