in First controller action method
var res = new ResponseModel(); // with many properties
//var routeValues = new RouteValueDictionary {
// { "res", JsonConvert.SerializeObject(res) }
//};
//return RedirectToAction("Index", "Customer", routeValues);
In Customer controller index method
public ActionResult Index(string res)
{
if (!string.IsNullOrEmpty(res))
{
var paymentRes = JsonConvert.DeserializeObject<ResponseModel>(res);
if (paymentRes.IsSuccessful)
{
ViewBag.paymentMessage = paymentRes.Message;
}
else
{
ViewBag.paymentMessage = paymentRes.ErrorMessage;
}
}
return View();
}
var res = new ResponseModel(); // with many properties
//var routeValues = new RouteValueDictionary {
// { "res", JsonConvert.SerializeObject(res) }
//};
//return RedirectToAction("Index", "Customer", routeValues);
In Customer controller index method
public ActionResult Index(string res)
{
if (!string.IsNullOrEmpty(res))
{
var paymentRes = JsonConvert.DeserializeObject<ResponseModel>(res);
if (paymentRes.IsSuccessful)
{
ViewBag.paymentMessage = paymentRes.Message;
}
else
{
ViewBag.paymentMessage = paymentRes.ErrorMessage;
}
}
return View();
}