---
title: "How to display count number of screen in Bootstrap"  
description: "How to display count number of screen in Bootstrap"  
author: "Sachin Singh"  
published: 2016-03-28  
updated: 2016-03-28  
canonical: https://www.mindstick.com/forum/34083/how-to-display-count-number-of-screen-in-bootstrap  
category: "bootstrap"  
tags: ["asp.net", "bootstrap", "asp.net mvc", "bootstrap modal", "bootstrap tab"]  
reading_time: 2 minutes  

---

# How to display count number of screen in Bootstrap

Hi Everyone,\
I have make a tab menu with the help of [bootstrap](https://www.mindstick.com/articles/1555/image-viewer-using-bootstrap-carousel) in my [asp.net](https://www.mindstick.com/articles/934/default-folders-available-inside-the-asp-dot-net-application-folder) [mvc application](https://www.mindstick.com/forum/12932/how-to-consume-webservices-from-asp-dot-net-mvc-application).and i want to display a number of [screen](https://www.mindstick.com/forum/33644/loading-screen-during-ajax-call)([Count](https://www.mindstick.com/forum/157774/selecting-count-with-distinct)) of the under [home](https://www.mindstick.com/articles/126322/how-to-keep-your-home-safe-while-traveling) tab.and display count in a [button](https://www.mindstick.com/articles/63/how-to-add-button-in-datagridview-in-csharp-dot-net) [name](https://yourviews.mindstick.com/view/87450/how-to-generate-a-brand-name-using-linkedin-comprehensive-guide) then after number of count.\
**Here, my [code](https://yourviews.mindstick.com/view/85458/alan-turing-the-mastermind-behind-cracking-the-enigma-code-during-world-war-ii):**\

```
@{    ViewBag.Title = "";    <script src="~/Scripts/jquery-1.9.1.min.js"></script>    <link href="~/Content/bootstrap.css" rel="stylesheet" />    <script src="~/Scripts/bootstrap.min.js"></script>} <html><body>    <div>        <ul class="nav nav-tabs" role="tablist">             <li role="presentation" class="active"><a href="#home" aria-controls="home" role="tab" data-toggle="tab">Home</a></li></ul>        <div class="tab-content">            <div role="tabpanel" class="tab-pane active" id="home">                <br />                <br />                <button class="btn btn-primary" type="button">                    Total Screens                 </button>                @foreach (var item in ViewBag.scr)                {                    <li>@item</li>                }            </div>
```

Please help me.

Thank you.

\
\

## Replies

### Reply by Anupam Mishra

Hi Sachin,\
You use this code:

```
<div>        <ul class="nav nav-tabs" role="tablist">             <li role="presentation" class="active"><a href="#home" aria-controls="home" role="tab" data-toggle="tab">Home</a></li>            @foreach (var item in ViewBag.scr)            {                 <li role="presentation"><a href="#adminpanel" aria-controls="adminpanel" role="tab" data-toggle="tab">@item</a></li>            }        </ul>        <div class="tab-content">            <div role="tabpanel" class="tab-pane active" id="home">                <br />                <br />                <button class="btn btn-primary" type="button">                    Total Screens <span class="badge">@ViewBag.count</span>                </button>                <br />                <br />                <br />                @foreach (var item in ViewBag.scr)                {                    <li>@item</li>                }            </div>        </div>    </div>
```

\
In Controller :

```
ViewBag.count = ScreenList.Count();
```

Output:

\

![How to display count number of screen in Bootstrap](https://www.mindstick.com/mindstickforums/5774ec58-70ca-42dc-b053-35c2304d0559/images/b2fd6a53-d328-4c42-97b7-b696dffa4b6a.png)\


---

Original Source: https://www.mindstick.com/forum/34083/how-to-display-count-number-of-screen-in-bootstrap

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
