Redirect To Another Post Method on failure of one in asp.net

91 Views Asked by At

I am having a post method A() in HomeController in controllers folder, when the method fails or throws some exception, I want to redirect to another post method A() which is in HomeController in Customer area, there are many customer with name eg. FirstCustomer, SecondCustomer,
For first method I am using attribute routing and route is /{customerName}/Home/A?id="xyz"
and using conventional routing for the another A method for which the route is /FirstCustomer/Home/A
I am using .net framework 4.6.1

I have tried return RedirectToAction("A", "Home", new {area = "FirstCustomer"})

but the RedirectToAction() is making the request get, so I am getting notfound error in browser console.

is there any work around for redirecting to another post method from one post method.

0

There are 0 best solutions below