How to Specify the Area name in ActionLink in ASP.NET MVC ?

Areas in ASP.NET MVC provides an option for the developers to separate the large ASP.NET MVC Web Application in to module grouping.

When using the ActionLink in ASP.NET MVC , How do one mention the area names too ?

How to Specify the Area name in ActionLink in ASP.NET MVC ?

The Html.ActionLink has an parameter which accepts the Html Attributes , just specify the Area in it and include the new{} as shown below.

@Html.ActionLink("AbundantCode-Sourcecode samples", "DisplayAction", "AbundantCodeController", new { Area = "TestAreaName" }, new{})
0saves
If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.
Pin It

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>