I tried this code
<%: Html.ActionLink("Home", "Index", "Home", new { @class = "NavLink" })%>
and it links to the css so that I can style the link, but it changes the link to have a different URL that is not to my controller like it is without the new { @class = "NavLink" }
. Is there any way to let me style these links without ruining my URLs so they go to the correct pages?
Thanks!
Make sure you are using the proper overload:
<%: Html.ActionLink("Home", "Index", "Home", null, new { @class = "NavLink" })%>
^ ^
routeValues htmlAttributes
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With