Assign CSS class to ActionLink

by Mikael Henriksson 7. April 2009 11:28

I can think of various way to hack and slash the HtmlHelpers or jQuery to do this for me but there is a much easier approach though it took me a long time to find! I thought this would be accomplished without the @ before class but I suppose there is a reason for this…

<%= Html.ActionLink("Print", 
"PrintInvoice", 
new { item.InvoiceID }, 
new { @class = "document" })%>

Tags:

MVC

blog comments powered by Disqus

About the author

Life architect specialized in programming

Month List

Widget Twitter not found.

Root element is missing.X