title: ASP.NET Core MVC Post Request from JQuery but need to redirect from Controller Action
body: <p>I have ASP.NET Core 2 MVC project. I am posting some data using JQuery to action.
  Suppose User.Identity.Name is null and I want to redirect to AccountController 
  AccessDenied action. 
  I am unable to use <code>RedirectToAction</code> (also removed return). Because this goes back to JQuery success/error.</p>
  
  <p><strong>Is there any solution to this?</strong></p>
  
  <p><strong>IN Controller</strong></p>
  
  <pre><code>if (string.IsNullOrEmpty(User.Identity.Name))
      return RedirectToAction(nameof(AccountController.AccessDenied), "Account");
  </code></pre>
  
  <p><strong>In My JS</strong>    </p>
  
  <pre><code>$.ajax({
          type: "POST",
          url: '/MyController/MyAction',
          dataType: "json",
          data: $(this).serialize(),
          success: function (data, status, xhr) {
  
          },
          error: function (xhr, status, err) {
              errorAlert(xhr.responseText, "ERROR");
          }
      });
  </code></pre>