0

I'm new to bootstrap/asp.net so I must be doing something wrong. All I want is a glyphicon from bootstrap to show up next to my button. As I understand, I cannot use asp:Button, but must use LinkButton.

Code:

//Head 

<link href="Content/bootstrap.min.css" rel="stylesheet" />
<meta name="viewport" content="width=device-width, initial-scale=1">


//Body

<form id="defaultform" runat="server">
  <div class="container">
   <asp:LinkButton    ID="ButtonGetProduct" 
                      runat="server" 
                      CssClass="btn btn-primary btn-lg"    
                      OnClick="ButtonGetProductName_Click">
              <span class="glyphicon glyphicon-barcode"></span>Register
    </asp:LinkButton>

  </div>
</form>

EDIT: Just added to my header, then replaced "glyphicon glyphicon-barcode" with "fa fa-barcode".. works just fine now!

Agneum
  • 727
  • 7
  • 23
  • 1
    There's not glyphicons in Bootstrap 4 (_if you haven't added them manually_) – Klooven Mar 27 '18 at 12:55
  • Anywhere I can read on how to add them manually? EDIT: Found https://stackoverflow.com/questions/32612690/bootstrap-4-glyphicons-migration – Agneum Mar 27 '18 at 13:06
  • Possible duplicate of [How do I put a Bootstrap Glyphicon inside an asp:Button in ASP.Net?](https://stackoverflow.com/questions/24285570/how-do-i-put-a-bootstrap-glyphicon-inside-an-aspbutton-in-asp-net) – VDWWD Mar 27 '18 at 13:08
  • @VDWWD that's exactly what I followed, didn't work. Probably because glyphicons were dropped in bootstrap 4. – Agneum Mar 27 '18 at 13:10

1 Answers1

0

Try this it will work

 <asp:LinkButton ID="LinkButton1" runat="server"><i class="glyphicon glyphicon-home"></i>Home</asp:LinkButton>

I am using bootstrap 3.

Diwas Poudel
  • 781
  • 1
  • 11
  • 20
  • Doesn't work with bootstrap 4. Unless you add them manually as VDWWD explained in the post above. Using or doesn't matter. – Agneum Mar 27 '18 at 14:21