How to specify an area name in an action link? Ask Question

How to specify an area name in an action link? Ask Question

I have a shared master page which I am using from 2 different areas in my mvc 2 app. The master page has an action link which currently specifies the controller and action, but of course the link doesn't work if I'm in the wrong area. I see no overload for actionlink that takes an area parameter, is it possible to do?

ベストアンサー1

Figured it out..

Html.ActionLink("Link Text", "ActionName", "ControllerName", new { Area = "AreaName" }, new{})

おすすめ記事