public ActionResult MakePayment(PaymentDetailModel model) { var path = Server.MapPath("~/App_Data/SavedData"); if (ModelState.IsValid) { PaymentBusiness payClass = new PaymentBusiness(); return(Json(payClass.SavePaymentData(path, model))); } else { string messages = string.Join("; ", ModelState.Values .SelectMany(x => x.Errors) .Select(x => x.ErrorMessage)); return(Json(JsonResponse.ErrorResponse(messages))); } }