title: Ajax.BeginForm, Calls Action, Returns JSON, How do I access JSON object in my OnSuccess JS Function?
body: <p><code>Ajax.BeginForm</code> calls an action and then returns JSON.
  How do I access JSON object in my <code>OnComplete</code> js function?</p>
  
  <p>so my <code>Ajax.BeginForm</code> looks like this...</p>
  
  <pre><code>using (Ajax.BeginForm("Coupon", new AjaxOptions { OnSuccess = "CouponSubmitted" }))
  </code></pre>
  
  <p>and my <code>OnSuccess</code> function looks like this...</p>
  
  <pre><code>function CouponSubmitted() {
      var data = response.get_response().get_object();
      alert(data.success);
  }
  </code></pre>
  
  <p>I also tried...</p>
  
  <pre><code>function CouponSubmitted(data) {
      alert(data.success); 
  }
  </code></pre>
  
  <p>My controller "Coupon" returns this...</p>
  
  <pre><code>return Json(new { success = false, nameError = nameError, emailError = emailError });
  </code></pre>
  
  <p><strong>Any ideas on how to access the Json that gets returned?</strong></p>