@ Html. ActionLink parameter formats: html. actionlink
Html. actionLink ("linkText", "actionName") the first parameter of this overload is the text to be displayed for the link, and the second parameter is the method of the corresponding controller, the default controller is the controller of the current page. If the controller of the current page is Products, then Html. actionLink ("detail", "Detail") generates <a href = "/Products/Detail"> all </a> second Html. actionLink ("linkText", "actionName", "controlName") this overload has an additional parameter than the first overload. It specifies the Controller name, such as Html. actionLink ("detail", "Detail", "Products") generates <a href = "Products/Detail"> all </a> Html. actionLik ("linkText", "actionName", routeVa Lues) routeValue can pass parameters to actions, such as Html. actionLink ("detail", "Detail", new {id = 1}) generates <a href = "Products/Detail/1"> detail </a>, assume that the current controller is Products. 4. Html. actionLink ("linkText", "actionName", routeValues, htmlAttributes) htmlAttribute can be used to set attributes of <a> tags, such as Html. actionLink ("detail", "Detail", new {id = 1}, new {target = "_ blank "}) <a href = "Products/Detail/1" target = "_ blank"> detail </a> is generated, it is necessary to write new {target = "_ blank", class = "cl AssName "}, an error is reported. Because class is a keyword, it should be written as @ class =" className ". 5. Html. ActionLink ("linkText", "actionName", "controlName", routeValues, htmlAttributes) this overload contains all the parameter types mentioned above