Umbraco 7 - Redirecting to another page from a controller
Asked Answered
D

2

6

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?

Duluth answered 4/1, 2014 at 11:12 Comment(0)
K
8

See below code, it will redirect to retrunUrl page.

 return this.Redirect(returnUrl);
Karylkarylin answered 4/1, 2014 at 15:52 Comment(0)
R
1

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
Rotary answered 29/7, 2014 at 9:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.