0

is it possible to bind a 'number' to a bootstrap badge. The 'number' is retrieved from Sql server using- select count(*) from dbo.table_name

as of now, i have button and when i click on it, i get the total number of rows of table in a alert box. I want to make use of bootstrap badges and is it possible that this badge contains the total number of rows every time i load the page.

Sbk3824
  • 1,229
  • 1
  • 14
  • 24

2 Answers2

0

With A tag:

 <a href="#">News <span class="badge">5</span></a><br>

With Button:

<button type="button" class="btn btn-primary">Primary <span class="badge">5</span></button>

Just put your result to replace the 5. It is very easy and possible.
With the Page load event,you can get the number when you load the page.

Kason
  • 787
  • 3
  • 14
0

you will be having the

HTML

<asp:Label runat='server' id='lblcount' class='label label-default'/>

In Cs

lblcount.Text =//value from the DB

So bootstrap badge class was given to the label For More Details please refer this link

Krsna Kishore
  • 8,233
  • 4
  • 32
  • 48