I want to style a link in my page and am using Html.ActionLink to create the link. The problem is I don't know how to style the resulting link. How do I add a CSS class to the Html.ActionLink in order to style it?
2 Answers
Html.ActionLink("Link Name",
"ActionName",
"ControllerName",
null,
new { @class = "myCssClass" }
)
2 Comments
Sachin Kainth
this doesn't give the resulting anchor tag a class but passing class as a parameter to the ActionName action.
Curtis
@SachinKainth Sorry I missed a parameter out! Please try again