In the AccountController, in the end of a method I have:
RedirectToAction("EveryView", "Account");
In the same controller file I have this method:
public ActionResult EveryView()
{
return View();
}
But this method never gets called. I have a breakpoint on '{' and it never gets hit!
RedirectToAction is meant for doing 302 redirects within your application and gives you an easier way to work with your route table. Redirect is meant for doing 302 redirects to everything else, specifically external URLs, but you can still redirect within your application, you just have to construct the URLs yourself.
Second, to pass multiple parameters that the controller method expects, create a new instance of RouteValueDictionary and set the name/value pairs to pass to the method. Finally call RedirectToAction(), specifying the method name, controller name, and route values dictionary.
you have put 'return' else it won't redirect.
return RedirectToAction("EveryView", "Account");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With