title: The required anti-forgery form field "__RequestVerificationToken" is not present
body: <p>here is another hurdle for me, I want my site to remain cross-site attacks protected, I'm developing a Master/Detail form by using asp.net mvc 5 through Ajax request, So, in order to create one entry, I've to go through the process of Ajax Request, this way :</p>
  
  <pre><code>$.ajax({
          url: '/Sales/Create',
          data: JSON.stringify(salesmain),
          type: 'POST',
          contentType: 'application/json;',
          dataType: 'json',
          success: function (result) {
  
              if (result.Success == "1") {
                  window.location.href = "/Sales/index";
              }
              else {
                  alert(result.ex);
              }
          }
      });
  </code></pre>
  
  <p>now, it is not navigating to the Create action in the Sales Controller, as the ajax request says, and before that, it throws the following exception :</p>
  
  <blockquote>
    <p>The required anti-forgery form field "__RequestVerificationToken" is not present.</p>
  </blockquote>
  
  <p>I've searched a lot on google but still unsuccessful, that's why I'm here, I've read some blogs which says fetch the hidden __RequestVerificationToken field using jquery and append it to the form values, enclosing the JSON.stringify(salesmain) in a function, this way :</p>
  
  <pre><code>$.ajax({
  .
  .
  addRequestVerificationToken(JSON.stringify(salesmain))
  </code></pre>
  
  <p>and the function :</p>
  
  <pre><code>function addRequestVerificationToken(data) {
  data.__RequestVerificationToken = $('input[name=__RequestVerificationToken]').val();
  return data;
  };
  </code></pre>
  
  <p>Plus, I already have below code structure :</p>
  
  <pre><code>@using (Html.BeginForm())
  {
    @Html.AntiForgeryToken()
    .
    .
  </code></pre>
  
  <p>and the attribute before the Create action :</p>
  
  <pre><code>[HttpPost]
  [ValidateAntiForgeryToken]
  public JsonResult Create([Bind(Include = "SalesId,ReferenceNo,SalesDate,SalesPerson")] SalesMain salesMain)
  {
  .
  .
  </code></pre>
  
  <p>and also I'm using jQuery 1.5, may be it is the culprit, if not then what should I do to resolve this issue? Any HELP will be deeply appreciated, Thanks in Advance :)</p>