title: How to implement a PUT call with JSON data using AJAX and JQuery?
body: <p>I've looked around and tried many different methods, but can't seem to pass actual data to my controller's function.</p>
  
  <p>Here is some code:</p>
  
  <pre><code>        var URL = "/Timesheet/Timesheet/UpdateEntry";
  
          var dataObject = { 'newWeekEntry': newEntry, 'oldWeekEntry': oldEntry };
  
          alert(JSON.stringify(dataObject));
  
          $.ajax({
              url: URL,
              type: 'PUT',    
              data: JSON.stringify(dataObject),
              dataType: 'json',
              success: function(result) {
                  alert("success?");
              }
          });
  </code></pre>
  
  <p><code>newEntry</code> and <code>oldEntry</code> are both objects.</p>
  
  <p>The <code>alert</code> line outputs this (with some properties removed, just for brevity): </p>
  
  <pre><code>{"newWeekEntry":{"MondayHours":2,"TuesdayHours":2,"WednesdayHours":5,"ThursdayHours":5,"FridayHours":"4","SaturdayHours":0,"SundayHours":0},"oldWeekEntry":{"MondayHours":2,"TuesdayHours":2,"WednesdayHours":5,"ThursdayHours":5,"FridayHours":2,"SaturdayHours":0,"SundayHours":0}}
  </code></pre>
  
  <p>When I debug my controller action ("UpdateEntry"), the two parameters are filled with the <code>TimesheetEntry</code> class default parameters (0).</p>
  
  <p>Am I passing this in properly?</p>