Problem
Okay, I did some research and find out that when you use
DataList
, it generates a table at the client side
HTML
. Due to which
carousel
is not working. One more problem was in the
ImageUrl
, which should be like
ImageUrl='<%# "images/small/" + Eval("image")%>'
.
Solution
If you use
Repeater
instead of
DataList
, it solves the issue and carousel works perfectly. I have tried this at my end.
So, the
Repeater
would look like...
<asp:Repeater ID="mylist" runat="server">
<HeaderTemplate>
<ul id="carousel" class="elastislide-list">
</HeaderTemplate>
<ItemTemplate>
<li><a href="#">
<asp:Image ID="Image1" runat="server" ImageUrl='<%# "images/small/" + Eval("image")%>' />
</a></li>
</ItemTemplate>
<FooterTemplate>
</ul></FooterTemplate>
</asp:Repeater>