title: Unable to debug WebMethod in ASPX on ajax call
body: <p>I am trying to send a screenshot done via <a href="http://html2canvas.hertzen.com/" rel="nofollow"><code>html2canvas</code></a> to the server using an AJAX call and the POST method, but it's not happening. When I am trying to debug the script using Firebug by setting breakpoints at the related lines, my application is not hitting the breakpoint.</p>
  
  <p>Here is my client-side code (using jQuery):</p>
  
  <pre><code>$("#excel").on("click", function (e) {
          e.preventDefault();
  
          html2canvas($("#placeholder").get(0), {
              onrendered: function (canvas) {
                  //document.body.appendChild(canvas);
  
                  var img = canvas.toDataURL().replace(/^data[:]image\/(png|jpg|jpeg)[;]base64,/i, "");
                  $.ajax({
                      "type": "POST",
                      "url": "Default.aspx/MyMethod",
                      "data": {
                          "imageData": img //Send to WebMethod
                      }
                  }).done(function (o) {
                      console.log(["Response:", o]);
                  });
  
              }
      });
  </code></pre>
  
  <p>And this is my server-side ASPX WebMethod:</p>
  
  <pre><code> [WebMethod()]
  public static void MyMethod(string imageData)
  {
  
      string fileNameWitPath = "D:/Kabir/custom_name.png";
      using (FileStream fs = new FileStream(fileNameWitPath, FileMode.Create))
      {
          using (BinaryWriter bw = new BinaryWriter(fs))
          {
              byte[] data = Convert.FromBase64String(imageData);//convert from base64
              bw.Write(data);
              bw.Close();
          }
      }
  </code></pre>
  
  <p>When I try to see it within Firebug, its status is <code>200 OK</code>. Why is this happening?</p>