title: WebMethod does not get called in vb.net codebehind file
body: <p>I have the following page method in the file default.aspx.vb, using .NET 2.0:</p>
  
  <pre><code>&lt;WebMethod()&gt; _
  Public Shared Function GetStatisticData(ByVal userId As Integer) As JavaScriptSerializer
      Dim stats As JavaScriptSerializer = New JavaScriptSerializer()
  
      stats.Serialize(statBiz.GetAllSaleStatistics(userId))
  
      Return stats
  End Function
  </code></pre>
  
  <p>And in default.aspx</p>
  
  <pre><code>opt.ajax({
      type: "POST",
      url: 'default.aspx/GetStatisticData',
      data: "{userId: 6601}",
      contentType: "application/json; charset=utf-8",
      dataType: "json",
      success: function (data) {
          console.log(data);
      },
      error: function (request, status, error, response) {
          console.log(error);
      }
  });
  </code></pre>
  
  <p>But the method in the codebehind file does never get hit and i get this error from the console log:</p>
  
  <pre><code>SyntaxError: Unexpected token &lt; in JSON at position 2
      at JSON.parse (&lt;anonymous&gt;)
      at n.parseJSON (jquery-1.12.4.min.js:11)
      at Xb (jquery-1.12.4.min.js:11)
      at y (jquery-1.12.4.min.js:11)
      at XMLHttpRequest.c (jquery-1.12.4.min.js:11)
  </code></pre>
  
  <p>Can somebody tell me what I am missing here?</p>