Search code examples
c#asp.net-mvcredirecttoaction

Resource cannot be found on RedirectToAction


I need redirect user depend of the result returned from Repository, nothing special. I do not have idea why this error happens. Here is the code:

[HttpPost]
public ActionResult Form(PaymentViewModel pvm)
  {
     string actionName = null;
     actionName = pr.MakePayment(pvm) == true ? "Success" : "Failed"; 
     return RedirectToAction(actionName, "Payment");
  }

Solution

  • Create the action methods with the following names under controller "Payment" 1. Success 2. Failed Thats it.

    Hope this helps!