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