Search code examples
c#asp.net-mvcbetaareas

How do I get Absolute Root Links in ASP.NET MVC 2.0 beta Areas?


The link for logging in looks like this:

<%= Html.ActionLink("Log On", "LogOn", "Account") %>

which yields the following link in the browser:

http://localhost:2300/Account/LogOn

However, if I switch to an Area, such as Content, the Login link now looks like this:

http://localhost:2300/Content/Account/LogOn

...which fails of course, because there is no AccountController in the Content Area.

How do I change my call to ActionLink so that it yields http://localhost:2300/Account/LogOn ?


Solution

  • Try RouteLink instead.