title: Ajax.BeginForm not hiding loading element when onBegin fails
body: <p>I'm using the Ajax.BeginForm helper in my MVC app. Here's a simplified example:</p>
  
  <pre><code>    &lt;% using (Ajax.BeginForm("actionName", new { Controller = "controller" }, new AjaxOptions
             {
                 OnBegin = "doValidation",
                 LoadingElementId = "ajaxLoader"
             }))
         { %&gt;
  </code></pre>
  
  <p>The problem is that if the OnBegin callback returns false, which correctly prevents the ajax call from being made, the loading element "ajaxLoader" is still displayed, and not hidden.</p>
  
  <p>I've tried using the OnFailure and OnComplete callbacks, but neither of these are called if the OnBegin callback fails.</p>
  
  <p>Interestingly the loading element is not displayed until <em>after</em> the OnBegin function has returned.</p>
  
  <p>I can get around this by explicitly showing and hiding the ajax loading element in custom javascript functions, but this seems like something the helper should really take care of for me.</p>