title: Make jQuery Ajax Call on Master Page?
body: <p>Am I missing something?  I'm trying to do a simple ajax call using jquery to a web service on my site and I get a 500 error every time when I make the call from the master page.  Has no one ever made an ajax call from a master page or am I just crazy and extremely deprived of sleep?</p>
  
  <p>Example:</p>
  
  <h2>MasterPage.master</h2>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      $(document).ready(function () {
          $.ajaxSetup({ dataType: "json", contentType: "application/json; charset=utf-8" });
  
          $.ajax({
              url: '&lt;%= ResolveUrl("~/Services/Test.asmx/HelloWorld") %&gt;',
              success: function (data) {
                  alert(data);
              },
              error: function (xhr, err) {
                  alert("readyState: " + xhr.readyState + "\nstatus: " + xhr.status);
                  alert("responseText: " + xhr.responseText);
              }
          });
  
      });
  &lt;/script&gt;
  </code></pre>
  
  <h2>/Services/Test.asmx</h2>
  
  <pre><code>&lt;WebMethod()&gt; _
  Public Function HelloWorld() As String
     Return "Hello World"
  End Function
  </code></pre>
  
  <p>See anything wrong?  Do I have a misunderstanding of the Master Page? Please help!</p>