title: Sending JSON object to WebMethod using AJAX
body: <p>I'm pulling in data from a HTML form and converting it to a JSON object to be sent to a WebMethod.</p>
  
  <p>Right now it says that I'm getting a success response, but I'm not sure how to check that it is correctly being sent to the WebMethod. I've tried debugging in VS2015, but can't seem to get to the break point.</p>
  
  <p>How can I test to see that I've set this all up correctly?</p>
  
  <p>Here is my html:</p>
  
  <pre><code> &lt;form id="addForm" name="addForm"&gt;
       &lt;input type="text"  name="playername" id="playername" placeholder="Player"/&gt; 
       &lt;input type="text" name="points" id="points" placeholder="Points" /&gt;
       &lt;input type="text" name="steals" id="steals" placeholder="Steals" /&gt;
       &lt;input type="text" name="blocks" id="blocks" placeholder="Blocks" /&gt; 
       &lt;input type="text" name="assists" id="assists" placeholder="Assists" /&gt;
       &lt;input type="text" name="mpg" id="mpg" placeholder="MPG" /&gt; 
       &lt;input type="text" name="shotpct" id="shotpct" placeholder="Shot %" /&gt;
       &lt;input type="text" name="threepct" id="3pct" placeholder="3 %" /&gt; 
       &lt;input type="button" value="add player" id="addbtn" name="addbtn" /&gt;
       &lt;/form&gt;
  </code></pre>
  
  <p>My Ajax</p>
  
  <pre><code>$("#addbtn").click(function () {
                  var form = JSON.stringify($("form").serializeArray());
  
  
                  $.ajax({
                      method: 'POST',
                      url: "players.aspx/addRow",
                      data: form,
                      success: function (data) {
                          alert('success');
                      },
                      error: function () {
                          alert('failure');
                      }
                  });
                });
  </code></pre>
  
  <p>and the web method where I'm trying to send the data</p>
  
  <pre><code>[WebMethod]
          public static void addRow(string form)
          {
  
              dynamic players = JObject.Parse(form);
          }
  </code></pre>
  
  <p>I'd like to what data is in players, if any (maybe getting a false positive from the AJAX).</p>