title: Callbacks on Ajax.BeginForm don't work
body: <p>I'm having difficulty getting the callbacks to work for a form.  I have something like this:</p>
  
  <pre><code>&lt;script&gt;
  function VendorCreated() {
    alert('ok');
  }
  &lt;/script&gt;
  
  @using (Ajax.BeginForm("Create", "Vendor", new AjaxOptions {
      UpdateTargetId = ViewBag.TargetId, 
      HttpMethod = "Post", 
      OnSuccess="VendorCreated",
      })) {
  </code></pre>
  
  <p>upon submission my function never gets created.  If I use:</p>
  
  <pre><code>OnSuccess="alert('ok')"
  </code></pre>
  
  <p>it works fine.  I've also tried:</p>
  
  <pre><code>OnSuccess="function() { VendorCreated(); }"
  </code></pre>
  
  <p>but I get a runtime error.  Others are having this issue but I've found no resolution, see <a href="https://stackoverflow.com/questions/4927479/mvc-3-razor-ajax-beginform-onsuccess">MVC 3 Razor - Ajax.BeginForm OnSuccess</a> and <a href="https://stackoverflow.com/questions/5572573/ajax-beginform-onbegin-confirmation-via-jquery-modal/5904928#5904928">Ajax.BeginForm OnBegin confirmation Via jquery modal</a>.</p>
  
  <p>If I look at the IE debugger (F12) I don't see a script tag in the code generated... what's the right approach?</p>