title: Json is not properly binded as c# object
body: <p>My app is made in <code>ASP.NET MVC 5</code>. User can use search form which is displaying filtered data. Now I want to add button which will export displayed data.</p>
  
  <p>To do this I am sending <code>Search</code> object to view and save it in html. Now When clicking export button I want to pass this object to controller, get data from database using this <code>Search</code> object and save results as <code>text</code>.</p>
  
  <p>The thing is I cant bind json to <code>c#</code> object. Thats my <code>view</code>:</p>
  
  <pre><code>&lt;div id="originalForm" style="visibility:hidden"&gt;
      @Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(Model))
  &lt;/div&gt;
  </code></pre>
  
  <p>This is my <code>ajax</code> code:</p>
  
  <pre><code>function exportRaportToCsv() {
      var $formData = $('#originalForm').text();
      var allIds = getCheckedIds();
  
      var dataToSend = JSON.stringify({
          ids: allIds,
          search: $formData
      });
  
  
      $.ajax({
          type: "POST",
          url: '@Url.Action("ExportToCsv", "BankCosts")',
          data: dataToSend,
          contentType: "application/json; charset=utf-8",
          success: function (datar) {
              window.location = '/BankCosts/Download?fileGuid=' + response.FileGuid
                  + '&amp;filename=' + response.FileName;
          },
          error: function (xhr) {
          },
      });
  }
  </code></pre>
  
  <p>And this is my controller:</p>
  
  <pre><code>[HttpPost]
  public ActionResult ExportToCsv(string[] ids, Search search)
  {
      // search is null here
  }
  </code></pre>
  
  <p>When I spy sending data with <code>Fiddler</code> I can see, that I am passing this:</p>
  
  <pre><code>{"ids":[],"search":"\n    {\"ID\":0,\"DateFrom\":\"2018-06-23T00:00:00\",\"DateTo\":\"2018-06-25T00:00:00\",\"hasUnrecognizedStatus\":false,\"skippedSearchResults\":0,\"paginationLimit\":100}\n"}
  </code></pre>
  
  <p>I think it is worth to mention, that <code>ids</code> is properly passed. If it contains data, that data is passed. I think the problem is that I have <code>\</code> in my <code>json</code>. How can I remove this? Is there something wrong with my <code>ajax</code>?</p>
  
  <p>When I use <code>console.log</code> to print <code>$formData</code> I can see that <code>\</code> characters are gone and it looks better:</p>
  
  <pre><code>{"ID":0,"DateFrom":"2018-06-23T00:00:00","DateTo":"2018-06-25T00:00:00","hasUnrecognizedStatus":false,"skippedSearchResults":0,"paginationLimit":100}
  </code></pre>