I am working Asp.Net Core. I need to call the action method from one controller to another.
I tried by using the RedirectToAction method. When I am using this, I get an error like "No route matched the supplied values".
Code I used:
return RedirectToAction("Logon", "Login");
We are using the route files like this
I am calling from MyItemsController to LoginController. The route of "Logon" is present in LoginRouteUrl file.
If I add the route in MyItemsRouteURL file means, the RedirectToAction is working. i.e) the method "Logon" in Login controller is executed. But I need to add the route for Logon in LoginRouteURL.
And I need to redirect the Action Result.
How to achieve this?