title: how to make the carousel Image slider from database in asp.net MVC?
body: <p>Suppose a product has multiple images, now in the product's details page, I want to display all those images as carousel slider. Now how can I implement this in asp.net mvc. Please help me out!!
  I have this set of codes - </p>
  
  <pre><code> @foreach (var item in ViewBag.Images)
                      {
                          for (int i = 0; i &lt; ViewBag.ImgCount;)
                          {
                              &lt;div id="myCarousel" class="carousel slide" data-ride="carousel"&gt;
  
                                  &lt;ol class="carousel-indicators"&gt;
  
                                      &lt;li data-target="#myCarousel" data-slide-to="@i"&gt;&lt;/li&gt;
  
                                  &lt;/ol&gt;
  
                                  &lt;!-- Wrapper for slides --&gt;
                                  &lt;div class="carousel-inner"&gt;
  
  
                                      &lt;div class="item"&gt;
                                          &lt;img src="~/img/@item.Image" alt="@Model.Name" style="width:100%;"&gt;
                                      &lt;/div&gt;
  
  
                                      &lt;!-- Left and right controls --&gt;
                                      &lt;a class="left carousel-control" href="#myCarousel" data-slide="prev"&gt;
                                          &lt;span class="glyphicon glyphicon-chevron-left"&gt;&lt;/span&gt;
                                          &lt;span class="sr-only"&gt;Previous&lt;/span&gt;
                                      &lt;/a&gt;
                                      &lt;a class="right carousel-control" href="#myCarousel" data-slide="next"&gt;
                                          &lt;span class="glyphicon glyphicon-chevron-right"&gt;&lt;/span&gt;
                                          &lt;span class="sr-only"&gt;Next&lt;/span&gt;
                                      &lt;/a&gt;
  
                                  &lt;/div&gt;
                              &lt;/div&gt;
                              i++;
                              break;
                          }
                      }
  </code></pre>
  
  <p>This is showing me all the images one by one...
  Please help me out in this.. I'm new to MVC...</p>