I created a Area in my MVC 3 application called \'Blog\'.
In global.asax I have the following code.
public static void RegisterRoutes(RouteCollection
I had the same issue as Mindstorm Interactive, and took a slightly different approach. Yes, it does redirect the user, but it made my code look less workaroundy so to speak.
I created a new controller, no matter in what area, since the problem is within the renderer not finding the view, not the controller.
The controller then redirects with the area (as in Mindstroms fix, the key) included, and voila.
public class StartController : Controller
{
public ActionResult Index()
{
return RedirectToAction("Index", "MyController", new { area = "MyArea" });
}
}
in the RouteConfig just add
routes.MapRoute(name: "Root", url: "", defaults: new { controller = "Start", action = "Index", area = "MyArea" });
Hope it helps someone.
The registration in your area appears to be wrong. You specify a default for your action but not for the controller. Since you typically have Home as the name of the controller you'd need to specify that.
Also it could be you don't have your folders setup correctly since you should have physically setup:
... and once you have fixed your blog area route you'll also need:
The error you get seems to pretty clearly indicate this is the issue.