I have added a new Area to my MVC3 project and I am trying to link from the _Layout page to the new Area. I have added an Area called \'Admin\' that has a controller \'Meets\'.<
Strange indeed. Steps that worked perfectly fine for me:
Admin
using Visual Studio designer by right clicking on the projectAdd new Controller in ~/Areas/Admin/Controllers/MeetsController
:
public class MeetsController : Controller
{
public ActionResult Index()
{
return View();
}
}
Add a corresponding view ~/Areas/Admin/Views/Meets/Index.cshtml
In the layout (~/Views/Shared/_Layout.cshtml
) add links:
@Html.ActionLink("Admin", "Index", "Meets", new { area = "Admin" }, null)
@Html.ActionLink("Admin", "Index", "Meets", new { area = "" }, null)
Rendered HTML for the anchors:
Admin
Admin
As expected the first link works whereas the second doesn't.
So what's the difference with your setup?