Asp.net-mvc – How to specify an area name in an action link

asp.net-mvcasp.net-mvc-2asp.net-mvc-areas

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?

Best Answer

Figured it out..

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