views:

303

answers:

2

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.

+6  A: 

Try this:

return RedirectToAction("index", "home", new { area = "" });
Dan Atkinson
Yes, I just tried this in my own project, and it does work.
Robert Harvey
Thank you, it worked. However, the ViewData seems to get lost :S I'll use Sessions instead :)
Mickel
You could also store the ViewData in TempData...
Dan Atkinson