title: how to validate the request using onBegin in Ajax.Begin Form?
body: <p><strong>Question</strong> : This code is not firing the <code>StartValidation function</code>. Why?</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
      &lt;script src="/Scripts/jquery-1.7.1.min.js" type="text/javascript"&gt;&lt;/script&gt;
      &lt;script type="text/javascript"&gt;
          $(document).ready(function () {
              $('#frmUp').find("input[type = 'submit']").click(function () {
                  $('#frmUp').submit();
              });
          });
          function StartValidation() {
              return true;
          }
      &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;div&gt;
          @using (Ajax.BeginForm("UploadRequestFile", "FileUpload", new AjaxOptions
              {
                  HttpMethod = "POST",
                  OnBegin = "return StartValidation();"
              }, new { id = "frmUp" }))
          {
              &lt;input type="submit" name="Submit" value="Submit" /&gt;
          }
      &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>Runtime markUp</strong></p>
  
  <pre><code>&lt;form method="post" id="frmUp" data-ajax-method="POST" 
        data-ajax-begin="return StartValidation();" data-ajax="true" 
        action="/fileupload/UploadRequestFile?Length=10"&gt;            
        &lt;input type="submit" value="Submit" name="Submit"&gt;
  &lt;/form&gt;
  </code></pre>