Does anyone know how I can add a class to the link rendered using the Html.RouteLink helper method in ASP.Net MVC, it has the htmlAttributes object as the last parameter which I assumed I would be able to use, but since class is obviously a reserved word, I cannot supply this as one of the properties on the object.
Just use uppercase for html attribute, like this:
<%= Html.RouteLink("Default", "Default",null, new { Class="css_class"}) %>
Try this:
<%= Html.RouteLink("Default", "Default",null, new { @class="css_class"}) %>
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