Reputation: 145
How do I use the Viewswitcher function of mvc 4 when I am using areas?
If I don't but a new ViewSwitcherController.cs in each area then I get areas about the route when I try to invoke the viewswitcher and I am in an area.
If I do put the viewSwitcherContoller in the area then I get errors about multiple controllers with the same name.
Upvotes: 0
Views: 69
Reputation: 145
I was being ignorant. The solution is to specify the area in the viewswitcher view.
@Html.ActionLink("Mobile view", "SwitchView", "ViewSwitcher", new { area="",
since there is no area I just used "" which is worked for me.
Upvotes: 1