title: ValidateInput(true) not working accepting html tags with ajax post call
body: <p>I want to block HTML tags. I'm passing HTML tags to action and it is accepting it. I have used [ValidateInput(true)] but still its accepting HTML. By default, validation is enabled but in this case, it is not working</p>
  
  <p>Im using ajax call to send data :</p>
  
  <pre><code>$.ajax({
      method: "Post",
      url: "/Home/MyAction",
      contentType: 'application/json',
      data: JSON.stringify({ htm: "&lt;span&gt;abc&lt;/span&gt;"}),
      success: function (d) {
          UnBlockUI();
          if ($.type(d) == "string")
              AccessDenied();
      },
      error: function (XMLHttpRequest, textStatus, errorThrown) {
          UnBlockUI();
          ErrorMessage("Something went wrong, please try again");
      }
  });
  </code></pre>
  
  <p>The code:</p>
  
  <pre><code>[ValidateInput(true)] 
  public ActionResult MyAction(string htm) 
  { 
      return View(htm); 
  } 
  </code></pre>
  
  <p>any solution to get rid of this problem</p>
  
  <p>Thanks :)</p>