title: Passing JSON Object from Javascript to ASP.Net
body: <p>I am trying to pass the Json string sObject from javascript to c#. In c# I am trying to load data from this JSon string to a Object.
  I get a Bad Request error in Javascript. </p>
  
  <h1>C# Entity Object:</h1>
  
  <pre><code>public class StatusEntity
  {
      public string WorkOrderID { get; set; }
      public string JobID { get; set; }
      public string ClientID { get; set; }
  }
  </code></pre>
  
  <h1>c# WCF Service:</h1>
  
  <pre><code>[WebInvoke(UriTemplate = "/updatestatus", Method = "POST", BodyStyle = WebMessageBodyStyle.WrappedRequest, ResponseFormat = WebMessageFormat.Json)]
  public string updateStatus(List&lt;StatusEntity&gt; _objStatus)
  {
      string sResult = string.Empty;
      try
      {
              // SOME CODE HERE
      }
      catch (Exception)
      {
          sResult = string.Empty;
          throw;
      }
      finally
      {
  
      }
      return sResult;
  }
  </code></pre>
  
  <h1>Javascript Code:</h1>
  
  <pre><code>function updateStatus() {
      var sObject = '[{"WorkOrderID":"9","JobID":"48","ClientID":"9"},{"WorkOrderID":"9","JobID":"48","ClientID":"10"}]';
      $.ajax({
          cache: false,
          type: "POST",
          async: false,
          url: "../JobMatchingService/updatestatus",
          contentType: "application/json; charset=utf-8",
          dataType: "json",
  
          // OLD CODE - NOT WORKING
          data: sObject,
          // NEW CODE CHANGES WORKING
          data: '{"_objStatus":' + _objStatus + '}',
  
          success: function (response) {
              alert(response);
          },
          error: function (xhr, options, error) {
              alert(error);
          }
      });
  }
  </code></pre>