The URL link for area can be divided into three cases: the first is to generate a link to the current area in the current area, and the second is to generate a link to another area, and the third is to generate a link to the root in an area. Here are the three ways to generate a link, using a route definition that is system default.
If you want to generate a URL link for the current area in area, just use the following method:
@Html. ActionLink ("Click Me", "about")
It generates the following HTML code based on the current area and controller:
<a href= "/admin/home/about" >click me</a>
If you want to generate a URL link for another area, you need to use a variable named area in the anonymous parameter of the Html.ActionLink method to specify the area name to generate the link, as follows:
It will find the definition of the route based on the area specified, assuming that the corresponding route is defined in the support area, then it will generate the following link:
<a href= "/support/home/index" >click me to go to another area</a>
If you want to generate a link to a controller in the root directory in the current area, simply place the area variable into an empty string, as follows:
@Html. ActionLink ("Click me to go to top-level part", "Index", new {area = "}")
It will generate the following HTML link:
<a href= "/home/index" >click me to go to top-level part</a>
Generate Area URL link