title: How to call ASMX webservice from MVC view?
body: <p>Following are the  WebService method i am trying to consume-:</p>
  
  <pre><code>    [WebMethod]
      public string HelloWorld()
      {
          return "Hello World";
      }
  </code></pre>
  
  <p>using ajax call for calling this method</p>
  
  <pre><code>$.ajax({
      type: "POST",
      url: "/WebServices/WebService1.asmx/HelloWorld",
      data: "{}",
      contentType: "application/json; charset=utf-8",
      success: function (msg) {
          var data = msg.d;
      },
      error: function (msg) {
          alert(msg.responseText);
      }
  });
  </code></pre>
  
  <p>But everytime i am getting error of resource not found might be because i am calling it from MVC view, i also tried to put whole localhost path <a href="http://localhost:60005/" rel="nofollow">http://localhost:60005/</a> still got the error of resource not found, could someone give me a small example of calling asmx webservice from MVC view?</p>