title: Ajax call showing error cant debug
body: <p>this is how the javascript looks like</p>
  
  <pre><code> &lt;script type="text/javascript"&gt;
    $(document).ready(function () {
      $('#loginButton').click(function () {
          //this.disabled = true;
          debugger;
          var data = {
              "userid": $("#username").val(),
              "password": $("#password").val()
          };
          $.ajax({
              url: "/Account/LoginPost",
              type: "POST",
              data: JSON.stringify(data),
              dataType: "json",
              contentType: "application/json",
              success: function (response) {
                  if (response.Success) {
                      $.get("@Url.Action("Search", "Home")", function (data) {
                          $('.container').html(data);
                      });
                  }
                  else
                      window.location.href = "@Url.Action("Index", "Home")";
              },
              error: function () {
                   alert('Login Fail!!!');
              }
          });
      });
   });
  </code></pre>
  
  <p>I am getting the alert('Login fail') also debugger not getting hit.
  I am using jquery 1.9.1 and have included unobstrusive</p>
  
  <p>my controller is this as you can i am passing string values not object values
  to the controller so stringify is justified here</p>
  
  <pre><code>[HttpPost]
  public JsonResult LoginPost(string userid, string password)
  {
      using (someentities wk = new someentities())
      {
          var LoginUser = wk.tblUsers.Where(a =&gt; a.Username.Equals(userid)&amp;&amp;a.Password.Equals(password)).FirstOrDefault();
          if (LoginUser != null)
          {
              FormsAuthentication.SetAuthCookie(userid,false);
              Session["Username"] = LoginUser.Username;
              Session["Password"] = LoginUser.Password;
              Session["Name"] = LoginUser.Name;
              return Json(new { Success = true }, JsonRequestBehavior.AllowGet);
          }
          else
          {
              TempData["Login"] = "Please Enter Correct Login Details";
              return Json(new { Success = false }, JsonRequestBehavior.AllowGet);
          }
      }
      // If we got this far, something failed, redisplay form
  }
  </code></pre>
  
  <p>when page is loading these error are shown </p>
  
  <blockquote>
    <p>$(..) live is not a valid function in
    (anonymous function) @ jquery.unobtrusive-ajax.js:115
    (anonymous function) @ jquery.unobtrusive-ajax.js:163</p>
  </blockquote>