How to specify an area name in an Action Link .Net MVC

Asp .Net MVC example about how to specify an area name in an Html.ActionLink. We can pass Area name in the RouteValues parameter present in the Html.ActionLink class. Area in MVC allows us to divide large application into smaller modules so that we can easily manage our source code.

How we can use Html.ActionLink Html.ActionLink:

@Html.ActionLink("Text To Display","ActionName","ControllerName","OptionalRouteValues","Optional_HTML_Attributes")

 

Html.ActionLink wiht Area Example:

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

This will generates following output:

Link Text

 

Checkout this tutorial for multiple examples of ActionLink Helper .Net MVC Html.ActionLink tutorial with examples
 
About Us | Terms of Use | Privacy Policy | Disclaimer | Contact Us Copyright © 2012-2024 CodingFusion
50+ C# Programs for beginners to practice