I am working with Umbraco 7 and with Umbraco for the first time. I am trying to redirect to another page from a custom controller that implements RenderMvcController.
I have tried ASP.NET MVC's return RedirectToAction("Index", "Home");
, but this does not seem to work.
Does anyone have an idea how to achieve this?
See below code, it will redirect to retrunUrl
page.
return this.Redirect(returnUrl);
Another way is using the RedirectResult class, where you can control if it should be a temporary (302) or a permanent (301) redirect:
return new RedirectResult("http://stackoverflow.com/", false); // 302
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