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

Published on February 20, 2013 by abundantcode

Filed under ASP.NET

Last modified February 20, 2013

Print this page

rate 1 star rate 2 star rate 3 star rate 4 star rate 5 star
Your rating: none, Average: 0 (0 votes)

This article have been viewed 5378 times

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{})
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.

Leave a Comment


You might be Interested in these Posts

How to set default value for Html.TextBoxFor in ASP.NET MVC ?

You can set the default value for the Html.TextBoxFor extension controls in ASP.NET MVC by specifyin...

ASP.NET MVC and View State

The ASP.NET Web Forms includes the Server Controls which generally retains the state of the controls...

C Program to find the G.C.D of a number using Recursive function

Problem Write a program in C to find the find the G.C.D of a number using recursion and display the ...