title: jquery.ajax calling a .aspx web method
body: <p>I had the below code working in a POC without variables and hard coded everything. After introducing variables to prepare for using this channel it stopped working. Likely, there is a syntax error I am not seeing, or (I don't dare say) this POC is not able to support such requests?</p>
  
  <p><strong>from my aspx page sendEmail.aspx</strong> </p>
  
  <pre><code>     [System.Web.Services.WebMethod]
                  public static string SendMyEmail(string EmailFromAddress, string EmailFromName, string EmailSubject, string EmailBody)
                  {
  
                      return "data from server: " + Environment.NewLine +
                              "EmailFromAddress = " + EmailFromAddress + Environment.NewLine +
                              "from = " + EmailFromName + Environment.NewLine +
                              "from = " + EmailSubject + Environment.NewLine +
                              "from = " + EmailBody;
  
                  }
  
      &lt;script type = "text/javascript"&gt;
      function ShowCurrentTime() {
          alert("hi");
  
          $.ajax({
              type: "POST",
              url: "SendEmail.aspx/SendMyEmail",
              data: '{EmailFromAddress: "mike", EmailFromName="mike", EmailSubject="email subject here", EmailBody="email body here"}',
              contentType: "application/json; charset=utf-8",
              dataType: "json",
              success: OnSuccess,
              failure: function (response) {
                  alert(response.d);
              }
          });
      }
  </code></pre>
  
  <p><strong>from my html web page:</strong></p>
  
  <pre><code>&lt;script type = "text/javascript"&gt;
  function ShowCurrentTime() {
      alert("hi");
  
      $.ajax({
          type: "POST",
          url: "SendEmail.aspx/SendMyEmail",
          data: '{EmailFromAddress: "mike", EmailFromName="mike", EmailSubject="email subject here", EmailBody="email body here"}',
          contentType: "application/json; charset=utf-8",
          dataType: "json",
          success: OnSuccess,
          failure: function (response) {
              alert(response.d);
          }
      });
  }
  
  function OnSuccess(response) {
      alert("all good");
  
      alert(response.d);
  }
  &lt;/script&gt; 
  &lt;/head&gt;
  &lt;body style = "font-family:Arial; font-size:10pt"&gt;
  &lt;form id="form1" runat="server"&gt;
  &lt;div&gt;
  Your Name : 
  &lt;asp:TextBox ID="txtUserName" runat="server"&gt;&lt;/asp:TextBox&gt;
  &lt;input id="btnGetTime" type="button" value="Show Current Time" 
      onclick = "ShowCurrentTime()" /&gt;
  &lt;/div&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>It works well when the web method has one pram (like below) even with multiple data points in the json data:</p>
  
  <pre><code>[System.Web.Services.WebMethod]
          public static string SendMyEmail(string EmailFromAddress)
          {
  
              return "good data from server: " + EmailFromAddress;
  
          }
  </code></pre>