title: jQuery ajax cannot call WebMethod
body: <p>My problem seems to have very simple solution and after searching on the SO and googling I couldn't find it.</p>
  
  <p>I've got a client script which is located in UrlUpdatePage.aspx. It's periodically making a call to get json from aspx to get current status of the operation and show message to user. Below is ajax call:
  </p>
  
  <pre><code>  var listenForStatusChanges = function () {
        $.ajax({
          type: 'GET',
          url: "/UrlUpdatePage.aspx/GetRunningState",
          data: "{}",
          contentType: 'application/json; charset=utf-8',
          dataType: 'json',
  
          success: function (data) {
            alert(data.IsRunning);
          }
        });
      };
  </code></pre>
  
  <p>In code-behind file UrlUpdatePage.cs I have such a method
  </p>
  
  <pre><code>[WebMethod]
  [ScriptMethod(UseHttpGet = true, ResponseFormat = ResponseFormat.Json)]
  public static string GetRunningState()
  {
      ...
      return jsonObj;
  }
  </code></pre>
  
  <p>The problem is when the ajax call is made, the <code>GetRunningState</code>method isn't triggered in debug mode and <code>success</code> callback isn't as well. Moreover, when I look at the details of the request in Firebug, the request is made but from the response tab I can see the call returns html markup, not the json data.</p>
  
  <p>What should be done to expose <code>GetRunningState</code> method to the client and get the json from the server? I use .NET 4</p>