title: Multiple arguments failing in ajax in a C# mvc app - More info added
body: <p>I'm missing something here.  This is my controller method</p>
  <pre><code>public void SubmitSweep(int personID, int DD, int MM, int YYYY, int hh, int mm, int dealId)
  </code></pre>
  <p>This is my button def</p>
  <pre><code>&lt;button id=&quot;submit@(person.Id)&quot; class=&quot;btn btn-secondary&quot; OnClick=&quot;submitSweep(@(person.Id), @(person.sweepDay), @(person.sweepMonth), @(person.sweepYear), @(person.sweepHour), @(person.sweepMinutes), @(person.dealId))&quot;&gt;Submit Sweep&lt;/button&gt;
  </code></pre>
  <p>This is my JS function</p>
  <pre><code>function submitSweep(thePersonID, sweepDay, sweepMonth, sweepYear, sweepHours, sweepMinutes, theDealId) {
          
          $.ajax({
              type: 'POST',
              url: '@Url.Action(&quot;SubmitSweep&quot;, &quot;Home&quot;)',
              contentType: &quot;application/json; charset=utf-8&quot;,
              dataType: &quot;json&quot;,
              data: JSON.stringify({ personID: thePersonID, DD: sweepDay, MM: sweepMonth, YYYY: sweepYear, hh: sweepHours, mm: sweepMinutes, dealId: theDealId }),
              success: function (data) {
                  alert(&quot;Success&quot;);
              },
              error: function (ob, errStr) {
                  alert(&quot;An error occured.Please try after sometime.&quot; + errStr + &quot; &quot; + ob.responseText);
              }
          });
      }
  </code></pre>
  <p>The function is being hit and the arguments are populated.  I've hacked around and determined that the issue is with the AJAX data field.  If I have no arguments in the controller, I get to my break point, so confident the error is in my data line.</p>
  <p>If I edit my JS Function to look like this</p>
  <pre><code>function submitSweep(thePersonID, sweepDay, sweepMonth, sweepYear, sweepHours, sweepMinutes, theDealId) {
          
          var obj = {};
          obj.personID = thePersonID;
          obj.DD = sweepDay;
          obj.MM = sweepMonth;
          obj.YYYY = sweepYear;
          obj.hh = sweepHours;
          obj.mm = sweepMinutes
          obj.dealId = theDealId;
  
          $.ajax({
              type: 'POST',
              url: '@Url.Action(&quot;SubmitSweep&quot;, &quot;Home&quot;)',
              contentType: &quot;application/json; charset=utf-8&quot;,
              dataType: &quot;json&quot;,
              data: obj, 
              success: function (data) {
                  alert(&quot;Success&quot;);
              },
              error: function (ob, errStr) {
                  alert(&quot;An error occured.Please try after sometime.&quot; + errStr + &quot; &quot; + ob.responseText);
              }
          });
      }
  </code></pre>
  <p>I get an error returned in markup, with the title tag saying Invalid JSON primitive: personID.  Note that I am passing the obj in the Data element.</p>
  <p>If I change the data line to</p>
  <pre><code>data: JSON.stringify(obj),
  </code></pre>
  <p>I then get mark up back with the title containing An item with the same key has already been added.  In both of the above scenarios, my controller break point is never hit.</p>
  <p>I'm running VS 2022, sp mostly newer libraries I guess.</p>
  <p>Any help or pointers would be immensely appreciated.</p>
  <p>Cheers</p>
  <p>J</p>