Monday, 24 December 2018

What is use of ActionLink in MVC

ActionLink is an HTML Helper method which generates hyperlinks in MVC application. It is a static overloaded method of type MvcHtmlString. Some of the examples are as follows.

@Html.ActionLink("Order Online""Edit""MenuItems")

First parameter "Order Online" is the String to Display in Page.Edit is the Controller action method.MenuItems is the Controller Class.

@Html.ActionLink("Department Details""Index""Department",new { area="AdminAccess"},null)


 In the above, we are using Area name when accessing the ActionLink.

@Html.ActionLink("Back to List""Index") 

 




No comments:

Post a Comment