title: jquery ajax call to webservice in mvc 4
body: <p>In my asp.net mvc4 project, i have the following markup and jquery in <strong>Index.cshtml</strong> -</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;script src="~/js/jquery-2.0.3.min.js"&gt;&lt;/script&gt;
  
  &lt;script type="text/javascript"&gt;
      $(function () {
          $('#btnLogin').click(function (e) {
  
              e.preventDefault();
              $.ajax({
                  type: "POST",
                  url: '@Url.Content("../../WebService1.asmx/HelloWorld")',
          data: "{}",
          contentType: "application/json; charset=utf-8",
          dataType: "json",
          async: true,
          success: function () {
              alert('success');
          },
          error: function () {
              alert('error');
          }
          });
  
          });
      });
  
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;form&gt;
      &lt;button "btnLogin"&gt;Sign in&lt;/button&gt;
    &lt;/form&gt;
  </code></pre>
  
  <p>
  </p>
  
  <p>But ajax call returns error. Any help ?</p>