简体   繁体   English

在mvc5中如何在文本后的导航栏中显示图标?

[英]In mvc5 how to show icon in navbar after the text?

我在用:

<@Html.ActionLink("logout", "Login", "Account", routevalues:null, htmlattributes: new{@class =glyphicon glyphicon-log-out,  Id="loginLink" })

You can put a span after the action link and assign icon class to span . 您可以在action link后放置一个span ,并将icon class指定给span

@Html.ActionLink("logout", "Login", "Account", null,  new{Id="loginLink" })  
<span class="glyphicon glyphicon-log-out"></span>

请改用Url Helper:

<a href="@Url.Action("Login", "Account")">logout <i class="glyphicon glyphicon-log-out"></i></a>

This is from my application. 这是我的申请。

 <a href=@Url.Action("ActionName", "ControllerName")>Add<i class="fa fa-plus-square-o"></i></a>

Hope Its Work !! 希望它的工作!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM