2

I am using areas in MVC version 3. My logoff and logon action methods are routing to the area, and I need them to route to the normal controller that is not in an area.

I have tried the following

host://AREA/CONTROLLER/METHOD instead of host://CONTROLLER/METHOD.

@if(Request.IsAuthenticated) {
    <text>Welcome <b>@Context.User.Identity.Name</b>
    [ @Html.ActionLink("Log Off", "LogOff", "Account", new { area = "" }) ]</text>
}
else {
    @:[ @Html.ActionLink("Log On", "LogOn", "Account", new { area = "" }) ]
}
Yannick Blondeau
  • 9,465
  • 8
  • 52
  • 74
Jim
  • 14,952
  • 15
  • 80
  • 167

1 Answers1

4

I have figured this out. Apparently I need the additional parameter, it's being applied to the wrong overload.

@Html.ActionLink("Log Off", "LogOff", "Account", new { area = string.Empty }, new {})
frictionlesspulley
  • 11,070
  • 14
  • 66
  • 115
Jim
  • 14,952
  • 15
  • 80
  • 167