How to use a repeater in a slider
I want to use a repeater in a slider with the following code style. I used 2 repeaters for the active elements and the rest of the elements. I have 6 pictures on each slider page. when i have more than 12 images, my problem is triggered (the content of the second relay is displayed on more than one line) ... I have no idea how to deal with this ... believe that I cannot use literal and generate slider code in code behind because I have to use asp controls in a repeater and I don't want to use more than two repeaters because I don't know how much data I have. (note that every 6 elements are placed in a div with class item
.
<%--Start Slider--%>
<div class="row-fluid">
<div class="span12">
<div class="container span12">
<div id="myCarousel2" class="carousel slide">
<!-- Carousel items -->
<div class="carousel-inner">
<div class="item active">
<div class="row text-center">
<asp:Repeater ID="rpSliderActive" runat="server">
<ItemTemplate>
<!-- ITEM-->
<div class="span2">
<div class="thumbnail product-item">
<img src='<%# Eval("PrintTemplate_URL").ToString().Replace("~", "../..") %>'>
</div>
<h6><%# Eval("PrintTemplate_Desc") %></h6>
<asp:LinkButton ID="LinkButton1" runat="server" class="btn btn-large btn-block"
OnClick="LinkButton1_Click"
ClientIDMode="Static"
infoprperty='<%# string.Format("{0};{1}",Eval("PrintTemplate_ID").ToString(),Eval("PrintTemplate_URL").ToString()) %>'>انتخاب »</asp:LinkButton>
<%--<a id="A1" class="btn btn-large btn-block" infoprperty="7;~/assets/img/LetterTemplates/02-2014108123656618.png"
href="javascript:__doPostBack('ctl00$ContentPlaceHolder1$rpSliderActive$ctl00$LinkButton1','')">انتخاب »</a>--%>
</div>
<!-- ITEM-->
</ItemTemplate>
</asp:Repeater>
</div>
</div>
<asp:Panel ID="pnlSliderRest1" class="item" runat="server">
<div class="row text-center">
<asp:Repeater ID="rpSliderRest1" runat="server">
<ItemTemplate>
<!-- ITEM-->
<div class="span2">
<div class="thumbnail product-item">
<img src='<%# Eval("PrintTemplate_URL").ToString().Replace("~", "../..") %>'>
</div>
<h6><%# Eval("PrintTemplate_Desc") %></h6>
<asp:LinkButton ID="LinkButton1" runat="server" class="btn btn-large btn-block" OnClick="LinkButton1_Click" ClientIDMode="Static"
infoprperty='<%# string.Format("{0};{1}",Eval("PrintTemplate_ID").ToString(),Eval("PrintTemplate_URL").ToString()) %>'>انتخاب »</asp:LinkButton>
</div>
<!-- ITEM-->
</ItemTemplate>
</asp:Repeater>
</div>
</asp:Panel>
</div>
<!-- /INNER-->
<!-- Carousel nav -->
<a class="carousel-control left" href="#myCarousel2" data-slide="prev"><i class="icon-chevron-left"></i></a>
<a class="carousel-control right" href="#myCarousel2" data-slide="next"><i class="icon-chevron-right"></i></a>
</div>
</div>
</div>
</div>
<%--End Slider--%>
+3
source to share
1 answer
<div class="slideshow" data-transition="crossfade" data-loop="true" data-skip="false">
<ul class="carousel">
<asp:Repeater ID="gallery" runat="server">
<ItemTemplate>
<li class="slide">
<img src='<%# DataBinder.Eval (Container.DataItem, "ImageUrl") %>' alt="" width="440" height="200" />
</li>
</ItemTemplate>
</asp:Repeater>
</ul>
</div>
0
source to share