title: Pass Html string from view to controller via ajax call
body: <p>I have a requirement where I need to pass all the HTML of a div tag to the controller. 
  I am able to get the HTML, but code fails when I am passing HTML via ajax.</p>
  
  <p>Here's my code.</p>
  
  <p><strong>View:</strong></p>
  
  <pre><code>function abc() {
  
    var html = $("#div").html();
  
    data = {
      Html: html
    };
  
    $.ajax({
          url: '@Url.Action("DisplayResult", "Default")', //
          data: data,
          type: "POST",
          contentType: "application/json; charset=utf-8",
          success: function(result) {
            //do something
          });
      },
      error: function(xhr) {
        alert("error");
      }
  });
  }
  </code></pre>
  
  <p><strong>My controller Action method:</strong></p>
  
  <pre><code>[HttpPost]
  public FileResult DisplayResult(string Html)
  {
      return null;
  }
  </code></pre>
  
  <p>I searched online and found a couple of related posts, but those were talking about different solutions like using <code>Html.Beginform()</code> and submit buttons - but none of those solutions suit my need.</p>