How to correctly use Html.ActionLink with ASP.NET MVC 4 Areas

后端 未结 4 972
野的像风
野的像风 2021-02-01 01:30

I recently discovered Areas in ASP.NET MVC 4, which I have successfully implemented, but I\'m running into troubles with the @Html.ActionLink helper in my Razor vie

4条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-01 02:23

    Below are some of the way by which you can create a link button in MVC.

    @Html.ActionLink("Admin", "Index", "Home", new { area = "Admin" }, null)  
    @Html.RouteLink("Admin", new { action = "Index", controller = "Home", area = "Admin" })  
    @Html.Action("Action", "Controller", new { area = "AreaName" })  
    @Url.Action("Action", "Controller", new { area = "AreaName" })  
    Edit  
    Customer from Germany  
    Customer from Mexico 
    

    Hope this will help you.

提交回复
热议问题