Ajax.BeginForm, Calls Action, Returns JSON, How do I access JSON object in my OnComplete JS Function?
so my ajax.beginform looks like this...
using (Ajax.BeginForm("Coupon", new AjaxOptions { OnSuccess = "CouponSubmitted" }))
and my OnSuccess Function Looks like this...
function CouponSubmitted() {
var data = response.get_response().get_object();
alert(data.success);
}
I also tried...
function CouponSubmitted(data) {
alert(data.success);
}
My controller "Coupon" returns this...
return Json(new { success = false, nameError = nameError, emailError = emailError });
Any ideas on how to access the Json that gets returned?