Strange indeed. Steps that worked perfectly fine for me:
- Create a new ASP.NET MVC 3 application using the default Visual Studio template
- Add an area called
Admin
using Visual Studio designer by right clicking on the project -
Add 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)
- Run the application.
Rendered HTML for the anchors:
<a href="https://stackoverflow.com/Admin/Meets">Admin</a>
<a href="http://stackoverflow.com/Meets">Admin</a>
As expected the first link works whereas the second doesn’t.
So what’s the difference with your setup?