title: Ajax.BeginForm with OnComplete always updates page
body: <p>I have simple ajax form in MVC. In AjaxOptions there is OnComplete set to simple javascript function which does one thing - returns false.</p>
  
  <pre><code>@using (Ajax.BeginForm("Action", "Controller", new AjaxOptions { UpdateTargetId = "DivFormId", HttpMethod = "Post", OnComplete = "preventUpdate" }))
  
  function preventUpdate(xhr) {
      return false;       
  }
  </code></pre>
  
  <p>The problem is, that page is already updated. E.g. in one case controller returns partial view after postback, in other case it returns some Json object. I want it to update page when partial view is returned, and to show dialog window when json is returned. Unfortunately when json is returned, it clears the page (update it with json) even when OnComplete function returns false as MSDN says: To cancel the page update, return false from the JavaScript function.</p>
  
  <p>How to prevent page update depending on received response?</p>
  
  <p>Thank you!</p>
  
  <p>----- UPDATE -------</p>
  
  <p>So far I found following solution. When I don't specify UpdateTargetId, I can do manually with the response what I want. But it is still not documented behaviour with return false.</p>