ASP.NET – Using Bootstrap Glyphicons in .NET Website

asp.net glyphicons

ASP.NET – Using Bootstrap Glyphicons in .NET Website

Sometimes it’s good practice to use a icon to indicate the button functionality. In asp.net, the default button doesn’t have any criteria to achieve this feature. So, I made a asp.net website in which I used the normal html buttons to achieve this. This example is using the bootstrap css. You can get additional info regarding Glyphicons over here

The design page :

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Glyphicons.aspx.cs" Inherits="Glyphicons" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
 <title>Bootstrap Elements</title>
 <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
 <style type="text/css">
 body
 {
 padding: 10px;
 }
 </style>
</head>
<body>
 <form id="form1" runat="server">
 <div>
 <button type="button" class="btn btn-warning btn-lg" id="Music" onserverclick="Is"
 runat="server">
 <span class="glyphicon glyphicon-music"></span>&nbsp;Music
 </button>
 <button type="button" class="btn btn-success btn-lg" onserverclick="Is" runat="server"
 id="Search">
 <span class="glyphicon glyphicon-search"></span>&nbsp;Search
 </button>
 <button type="button" class="btn btn-primary btn-lg" onserverclick="Is" runat="server"
 id="Contacts">
 <span class="glyphicon glyphicon-user"></span>&nbsp;Contacts
 </button>
 <button type="button" class="btn btn-default btn-lg" onserverclick="Is" runat="server"
 id="Settings">
 <span class="glyphicon glyphicon-cog"></span>&nbsp;Settings
 </button>
 <button type="button" class="btn btn-danger btn-lg" onserverclick="Is" runat="server"
 id="Delete">
 <span class="glyphicon glyphicon-trash"></span>&nbsp;Delete it!
 </button>
 <asp:TextBox runat="server" ID="inputError" />
 <asp:Label runat="server" ID="txt" />
 <br />
 <hr />
 </div>
 </form>
</body>
</html>

This will produce the buttons with the bootstrap icons as shown in the image above.

Thank You.

See Also :

 

You might be interested in :

ASP.NET GridView with Buttons  

ASP.NET GridView with checkboxes

ASP.NET menu control – A great looking alternative

ASP.NET Sidebar Menu with Profile Image – A great looking alternative

How to use Google fonts in ASP.NET

How to host ASP.NET Website in IIS


1 thought on “ASP.NET – Using Bootstrap Glyphicons in .NET Website”

  1. Pingback: Glyphicon Login - My Blog

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.