title: Unknown WebMethod error while calling it from Jquery using Ajax
body: <p>I have a web method that i am trying to call from jquery ajax but it is not getting invoked.
  In firebug When i saw the response i get,</p>
  
  <pre><code>&lt;title&gt;Unknown web method MyMethod.&lt;br&gt;Parameter name: methodName&lt;/title&gt;
  </code></pre>
  
  <p>error.I am not able to get the reason why this error is coming when that method is available at the server  side..
  Here is my client side code..</p>
  
  <pre><code>$("#excel").on("click", function (e) {
              e.preventDefault();
              var img = "image";
              $.ajax({
                  type: "POST",
                  url: "Default.aspx/MyMethod",
                  data: JSON.stringify({ imageData: img }),
                  contentType: "application/json; charset=utf-8"
              }).done(function (o) {
                  console.log(["Response:", o]);
              });
          });
  </code></pre>
  
  <p>And here is my server side code..</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>Please help me to solve this issue as i am completely struck into this.
  Thanks in advance..</p>