andrey.shedko andrey.shedko - 5 months ago 27
C# Question

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:

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

Answer Source

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

Hope this helps!

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download