How do I apply a CSS class to Html.ActionLink in ASP.NET MVC?

前端 未结 7 683
借酒劲吻你
借酒劲吻你 2020-12-01 06:02

I\'m building an ASP.NET MVC application, using VB.NET and I\'m trying to apply a css class to a Html.ActionLink using the code:



        
7条回答
  •  既然无缘
    2020-12-01 06:22

    In VB.NET

    <%=Html.ActionLink("Contact Us", "ContactUs", "Home", Nothing, New With {.class = "link"})%>
    

    This will assign css class "link" to the Contact Us.

    This will generate following HTML :

    Contact Us
    

提交回复
热议问题