title: MVC page to page redirection
body: <p>I'm new to MVC (using 4, framework 4.0) and I understand the basics but this page redirect isn't working as I expect.  The application is a login/authentication which if the user successfully logs in it redirects them to the target application.  That part works just fine.  However the user may forget his/her login credentials, so I have a series of pages that will prompt the user for a registered email address and decoded captcha value.  If that information is validated then another page prompts for a series of (up to 3) pre-determined security question answers (in the case of a password forgotten).  If the security challenge question is successfully answered the user is redirected to a password change page.  At any point in the process the user may click a cancel button which should redirect back to the login page and clear any state variables tracking their progress through the recovery process.  The problem is I keep getting stuck on pages that even after a RedirectToAction("SomeAction", "SomeController"); I still stay on the page?  The URI even changes on the browser but the page asking for email address or security question stays active.  I'm using an ajax $.get() to call various actions for submit and cancel.</p>
  
  <p>view is defined like this:</p>
  
  <pre><code>@using (Html.BeginForm("RecoverUserCredentialsByModel", "Account", FormMethod.Get, new { id = "form1" }))
  {
  &lt;!--... three input controls and a submit and cancel button--&gt;
  &lt;p&gt;
          &lt;button id="btnSubmit" onclick="return CheckUserEmail()"&gt;Submit&lt;/button&gt;
          &lt;button id="btnCancel" onclick="return CancelRecovery()"&gt;Cancel&lt;/button&gt;
  &lt;/p&gt;
  }
  
  &lt;script type="text/javascript"&gt;
          function CheckUserEmail() {
              var emailAddress = document.getElementById("EmailAddress").value;
              var pictogramHref = document.getElementById("pictogramHref").src;
              var pictogramAnswer = document.getElementById("Pictogram").value;
              if (emailAddress != null) {
                  var url = "/Account/ValidateEmail"; 
                  $.get(url, { "emailAddress": emailAddress, "pictogramHref": pictogramHref, "pictogramTranslation": pictogramAnswer }, null);
                  return true;
              }
          }
  &lt;/script&gt;
  
  &lt;script type="text/javascript"&gt;
      function CancelRecovery() {
          var url = "/AuthenticationModule/Account/CancelRecovery";
          $.get(url, {}, null);
          return true;
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>Codebehind redirections look like:</p>
  
  <pre><code>/// &lt;summary&gt;
  /// Global cancel recovery, clears the stateful session object and redirects back to login view
  /// &lt;/summary&gt;
  /// &lt;returns&gt;ActionResult&lt;/returns&gt;
  [AllowAnonymous]
  public ActionResult CancelRecovery()
  {
          LoginModel statefulLoginModel = null;
          try
          {
              // Reset everything active and redirect to login view
              statefulLoginModel = new LoginModel();
              Session["LoginModel"] = statefulLoginModel;
              return Redirector(statefulLoginModel);
          }
          catch (Exception ex)
          {
              // Log the error and Reset everything active and redirect to login view
              FileLogger.Log(ex);
              statefulLoginModel = new LoginModel();
              Session["LoginModel"] = statefulLoginModel;
              return Redirector(statefulLoginModel);
          }
  }
  
  [AllowAnonymous]
  public ActionResult Redirector(LoginModel model)
  {
  ... some code
              Session["LoginModel"] = statefulLoginModel;
              if (loginState == 0)
              {
                  RedirectToAction("LogOn");
              }
  
  }
  </code></pre>
  
  <p>When it hits the RedirectToAction("LogOn"); the view "RecoverUserInfo" stays active on the browser and no redirection occurs?  </p>
  
  <p>What am I doing wrong?</p>