How can I change the colors of the hyperlink created by the helper function Html.ActionLink?
[additional detail] The colors will have to be different for each state of the hyperlink, i.e. active, selected, was already selected, etc.
@Html. ActionLink("name", "Action", "Controler", new { id= sentId, Style = "color:White" }, null);
In the "Styles:" section, select Hyperlink, and then click Modify.... From the list under "Font Color:", choose the color you want. To save your changes, click OK, and then OK again.
Html. ActionLink creates a hyperlink on a view page and the user clicks it to navigate to a new URL. It does not link to a view directly, rather it links to a controller's action.
Yes, there is a difference. Html. ActionLink generates an <a href=".."></a> tag whereas Url. Action returns only an url.
Typically you would do something like this:
Html.ActionLink("My Link", "MyAction", null, new { @class = "my-class" })
And then use CSS to style my-class
:
a.my-class { color: #333333 }
a.my-class:active { color: #666666 }
a.my-class:link { color: #999999 }
a.my-class:visited { color: #CCCCCC }
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