Passing the string "recentlyupgraded" from the controller to the ajax success event and checking it at the ajax success event is my current objective. Here's the code in My Controller:
[HttpPost]
[AuthorizeEnum(UserRole.Normal, UserRole.Power)]
public ActionResult BusinessUpdate(BusinessSetting business) {
ActionResult _returns;
if (viewModel.BusinessSettingUpdate(business)) viewModel.InitalizeBusiness();
if (Session["recentlyUpgraded"] != null && (bool) Session["recentlyUpgraded"]) {
_returns = Json("recentlyUpgraded",JsonRequestBehavior.AllowGet);
});
} else {
_returns = PartialView("_Business", viewModel.Business);
}
return _returns;
Now I need to verify it at the ajax success event with this code:
function OnSuccess(formName) {
$(formName).removeData("validator");
$(formName).removeData("unobtrusiveValidation");
$.validator.unobtrusive.parse(formName);
alert(formName.innerHTML);//this code gives undefined
}
function OnComplete(request, status) {
$("#DetailandSetting").fadeTo('slow', 1);
// alert(JSON.stringify(request));
// if (request.innerhtml = "recentlyUpgraded") {
// window.location.href = '/NMPAccount/LogOff';
// }
}
Note: This is an ajax form.