title: Webmethod call from jQuery AJAX gives 404 Error
body: <p><strong>UPDATE</strong></p>
  
  <p>I have used:  under <code>&lt;system.WebServer&gt;</code> in <code>web.config</code>, which solved the problem. I cannot find a good explanation to the question "why so" anywhere. So for the sake of future comers to this question, please share your knowledge with us..</p>
  
  <hr>
  
  <p>I am posting only one example of this, but it is the same issue with all my WebMethod calls throughout my site.</p>
  
  <pre><code>$.ajax({
      type: "POST",
      url: "Settings.aspx/myFunction",
      data: "{'pagename': '" + elid + "'}",
      dataType: "json",
      contentType: "application/json; charset=utf-8",
      success: function (msg) {
         ' do something
      }
  });
  </code></pre>
  
  <p>when this (or other) WebMethods are called, I am getting a "HTTP 404.0 The resource you are looking for has been removed, had its name changed, or is temporarily unavailable." error.</p>
  
  <p>I guess it is looking for "<code>myFunction</code>" as a seperate web page instead of a method function..</p>
  
  <p>myFunction is declared as below in Settings.aspx.vb</p>
  
  <pre><code>&lt;WebMethod()&gt; _
  Public Shared Function myFunction(pagename As String) As String
      ' code not shown for clarity
  End Function
  </code></pre>
  
  <p><code>System.Web.Services</code> namespace is also imported.</p>
  
  <p>Everything works as expected on my development machine but it does not work on the production server. I suspect it is something to to with the configuration settings but this is a clone project of another couple of other projects which works just fine on the same machine with the same code..</p>
  
  <p>I have gone through the web.config and made sure everything else are the same with the other cloned web sites.</p>
  
  <p>I am on a dedicated windows 2008 server with IIS 7.5 installed and Plesk.</p>
  
  <p>Any ideas why this is the case?</p>