title: Ajax request is not working with ASP.NET page method
body: <p>I tried so many example codes and neither works. Ajax call simply does not return anything. There is no alert popup.</p>
  
  <p>This is the ajax code :</p>
  
  <pre><code>&lt;script src="Scripts/jquery-1.10.2.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt; 
      $(document).ready(function() {
          $.ajax({         
              type: "POST",
              url: "mysqlcall.aspx/Testing",
              contentType: "application/json; charset=utf-8",
              data: {""},
              dataType: "json",
              success: function (data) {
                  alert("idkbro");
                  //  $("#testing").text(response.d);
              },
              failure: function (response) {
                  alert(response.d);
              }
          });
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>And this is the call page :</p>
  
  <pre><code>public partial class mysqlcall : System.Web.UI.Page
  {
      protected void Page_Load(object sender, EventArgs e)
      {    
      }
  
      public string Testing()
      {
          return "asdlasldalsdl";
      }
  }
  </code></pre>
  
  <p>I'm running it on latest version of IIS and using asp.net C# webforms with routing. mysqlcall.aspx is not routed but it doesn't matter I tried it with a routed page. Any help would be appreciated.</p>
  
  <p>Edit : Thanks to @wazz the problem was in the </p>
  
  <pre><code>url: "mysqlcall.aspx/Testing",
  </code></pre>
  
  <p>instead it has to begin with a slash like :</p>
  
  <pre><code>url: "/mysqlcall.aspx/Testing",
  </code></pre>