title: getting anonymous function error in ajax
body: <p>I call the Ajax to get the result from web API in my MVC project. in my local the page works but in production it is not working and giving me this error in .js file exactly at this line: $.ajax </p>
  
  <p><a href="http://mylink.cloudapp.azure.com/searchuser" rel="nofollow">http://mylink.cloudapp.azure.com/searchuser</a> 404 (Not Found)</p>
  
  <p>x.extend.ajax   anonymous function</p>
  
  <p>This is my .js file:</p>
  
  <pre><code>$(document).ready(function () {
  $('#btnSearch').click(function (evt) {
     // debugger;
      if (ValidateInput()) {
          var data = {
              LastName: $.trim($('#LastName').val() || ''),
              Zip: $.trim($('#Zip').val() || ''),
              Ssn: $.trim($('#Ssn').val() || '')
          };
          var token = $('[name=__RequestVerificationToken]').val();
  
          $.ajax({
              dataType: "json",
              //headers: { "__RequestVerificationToken": token },
              data: data,
              url: '/searchuser',
              type: 'POST',
              cache: false,
              success: function (result) {
                  console.log(result);
                  if (result &amp;&amp; result.success) {
                      $('#ApplicationId').val(result.data.applicantId);
                      if (result.data.exception == null) {
                          $('#stepTwo').show();                         
                          $('#EmailAddress').val(result.data.userEmailAddress);
                      }
                      else {
                          $('#txtareaResponse').val(result.data.exception);
                      }
                  }                   
              },
              error: function () { debugger; alert('failure'); }
          });
      }
  });
  </code></pre>
  
  <p>and this is top of my view:</p>
  
  <pre><code>&lt;script src="~/Scripts/jquery-1.10.2.min.js"&gt;&lt;/script&gt;
  
  &lt;link href="~/Content/Loan.css" rel="stylesheet" /&gt;
  &lt;script src="~/Scripts/Verify.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>and this is the controller method:</p>
  
  <pre><code>    [AllowAnonymous]
      [Route("searchuser")]
      [HttpPost]
      public async Task&lt;ActionResult&gt; SearchUser(UserInfo userInfo)
      {
          object userObject = null;
            if (userInfo.LastName != null &amp;&amp; userInfo.Zip != null &amp;&amp; userInfo.Ssn != null)
              {
                  string accessKey = CreateAccountKey(userInfo.LastName, userInfo.Zip, userInfo.Ssn);
  
                  UserKey userKey = new UserKey();
                  userKey.AccountKey = accessKey;
                  //var response = await httpClient.GetAsync(string.Format("{0}{1}/{2}", LoanApiBaseUrlValue, "/verifyuser", accessKey));
                  var response = await httpClient.PostAsJsonAsync(string.Format("{0}{1}", LoanApiBaseUrlValue, "/verifyuser"), userKey);
                  if (response.IsSuccessStatusCode)
                  {
                      userObject = new JavaScriptSerializer().DeserializeObject(response.Content.ReadAsStringAsync().Result) as object;
                      var json = response.Content.ReadAsStringAsync().Result;
                      var userVerify = new JavaScriptSerializer().Deserialize&lt;VerifyUser&gt;(json);
                  }
              }
              var respone = new
              {
                  success = userObject != null,
                  data = userObject
              };
              return Json(respone, JsonRequestBehavior.AllowGet);
          }
  </code></pre>