Redirect from one Area's action to a action in the "root"-area?

Mickel picture Mickel · Jan 13, 2010 · Viewed 17.5k times · Source

I use the latest version of ASP.Net MVC 2 RC.

My question is, how do I redirect from one action that's in the "Blog"-area to the index-action in the home-controller that exists in the "root" of my application (no area)?

I tried:

return RedirectToAction("index", "home");

but this redirects to /Blog/home, where Blog is the name of my Area.

Answer

Dan Atkinson picture Dan Atkinson · Jan 13, 2010

Try this:

return RedirectToAction("index", "home", new { area = "" });