Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use a Twitter Bootstrap icon inside an ASP.NET Button?

How can I use a:

<i class="icon-etc"></i> 

with an asp.net button?

like image 938
Korv Avatar asked Apr 27 '12 14:04

Korv


2 Answers

LinkButton, like this...

<asp:LinkButton ID="SelectButton" runat="server" CssClass="btn btn-info"><i class="icon-ok icon-white"></i>&nbsp;Select</asp:LinkButton>
like image 181
Theo Avatar answered Oct 16 '22 10:10

Theo


You may add the <i> tag as a value to the LinkButton Text attribute.

e.g.

<asp:LinkButton ID="btnExcluir" runat="server" Text="<i aria-hidden='true' class='icon-remove-3'></i>" CssClass="btn btn-danger" />

You can even use it with a side text.

e.g.

<asp:LinkButton ID="btnExcluir" runat="server" Text="Link Name&nbsp;<i aria-hidden='true' class='icon-remove-3'></i>" CssClass="btn btn-danger" />
like image 10
felipe Avatar answered Oct 16 '22 09:10

felipe