title: data-ajax-success function not called in .net mvc webapplication
body: <p>I am working on MVC .Net web application. My _Layout page has a modal popup which render a partial view.
  This Partial view _LoginPartial contains following form</p>
  
  <pre><code>@model WebsiteMVC.Web.ViewModels.LoginViewModel
  &lt;script&gt;
      function LogInComplete() {
          var temp = $("#IsLoggedIn").val();
          if (temp == 'true') {
              document.location = "ThankYou";
          }
      };
  &lt;/script&gt;
  &lt;div id="myLoginForm"&gt;
      &lt;h2&gt;Login&lt;/h2&gt;
  
  
      @using (Ajax.BeginForm("Login", "Account", new AjaxOptions { HttpMethod = "POST", UpdateTargetId = "myLoginForm",InsertionMode = InsertionMode.Replace, OnSuccess = "LogInComplete" }))
      {
          //Form body
      }
  &lt;/div&gt;
  </code></pre>
  
  <p>My Login method in Controller is</p>
  
  <pre><code>public async Task&lt;ActionResult&gt; Login(LoginViewModel model, string returnUrl)
  {
      var loginSuccess = await PerformLoginActions(model);
      if (loginSuccess)
      {
          model.IsLoggedIn = true;
      }
      return PartialView("_LoginPartial", model);
  
  
  }
  </code></pre>
  
  <p>Even after getting 200 response for POST request OnSuccess is not called.
  I tried adding OnFailure but none of the two methods is called. 
  I am new to MVC .Net</p>