ID "conflict" within Datalist

Asked

Viewed 88 times

0

Good afternoon to everyone. Well, I have a datalist. Then I put a Repeater in, so far so good. But then when I execute, only the first Remap appears stylized the way I want. The rest I think should change the id, and end up appearing without formatting. Well by the looks of it, it must be my Jquery and Jcarousel links that are giving this problem. But I still don’t know how to fix it. Someone would have some hint, a light to show me? http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js http://cdn.jsdelivr.net/jcarousel/0.2.8/jquery.jcarousel.min.js

//Eis o código do meu datalist

 <asp:DataList ID="dlCustomers" runat="server" DataSourceID="ObjectDataSource2" RepeatColumns="1" RepeatDirection="Horizontal" HorizontalAlign="Center" OnItemDataBound="dlCustomers_ItemDataBound" OnSelectedIndexChanged="dlCustomers_SelectedIndexChanged" Width="85%">
                <ItemStyle HorizontalAlign="Center" />
                <ItemTemplate>
                    <asp:Label ID="lblCat" runat="server" Text='<%# Eval("Tipo") %>' visible="false"/>
                    <asp:Label ID="lblImagem" runat="server" Text='<%# Eval("Imagem") %>' Visible="False" />
                    <img src="<%# Eval("Caminho") + "" +Eval("Imagem") %>" width="200px" height="130px" id="imgPro"/>
                    <br />
                    <asp:Label ID="CodigoLabel" runat="server" Text='<%# Eval("Codigo") %>' Visible="False" />
                    <br />
                    <asp:LinkButton ID="btnPro" runat="server" CssClass="but" Text='<%# Eval("Descriçao") %>' href='<%# "Categorias.aspx?Codigo=" + Eval("Codigo") + "&Tipo=" + Eval("Tipo") %>'></asp:LinkButton>
                    <br />
                    <asp:Button ID="btnAlterar" runat="server" Text="Alterar" Visible="False" />
                    <br />
                    <asp:Button ID="btnExcluir" runat="server" OnClientClick="javascript:return confirm('Tem certeza que deseja excluir um grupo?');"  Text="Excluir" Visible="False" />
                    <br />
                    <asp:Button ID="btnVisivel" runat="server" Height="21px"  Text="Visibilidade" Width="93px" Visible="False" />
                    <br />
                    <br />
                    <br />
                    <ul id="mycarousel" class="jcarousel-skin-tango">
                    <asp:Repeater ID="rptImages" runat="server">
                        <ItemTemplate>
                            <li>
                                <img alt="" style='height: 75px; width: 75px' src='<%# Eval("Caminho") + "" +Eval("Imagem") %>' />
                            </li>
                        </ItemTemplate>
                 </asp:Repeater>
                </ul>
                </ItemTemplate>
            </asp:DataList>
  • 1

    Hello Vinicius. You can also post the CSS of your Repeater?

  • 1

    Vinicius, you tried to use class instead of id to stylize the components?

  • <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script><link http://cdn.jsdelivr.net/jcarousel/0.2.8/skins/tango/skin.css" rel="Stylesheet" /> <script type="text/javascript" src="http://cdn.jsdelivr.net/jcarousel/0.2.8/jquery.jcarousel.min.js"></script> is where you find my css, jquery.....

  • @Guilhermedejesussants have no idea what they might be?

1 answer

0


Well, after a lot of searching on Facebook groups, forums, I got the answer. In the forum aspforums.net a guy helped me. You suggested I change this line of code

$(function () {
     $ ( "# Mycarousel ') jcarousel (.);    
});

For that reason

$(function () {
     $('[id*=mycarousel]').jcarousel();
});

So that’s the answer, in case anyone needs help. And thank you for taking the time to try and help.

  • Really if you used the first function, $ ( "# Mycarousel ') jcarousel (.); it contains syntax errors. The correct syntax would be : $('#mycarousel').jcarousel();.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.