More in this section

Forums / Developing with Sitefinity / AlternatingItemTemplate of Repeater control inside Control templates

AlternatingItemTemplate of Repeater control inside Control templates

2 posts, 0 answered
  1. Cristian Grisolia
    Cristian Grisolia avatar
    6 posts
    Registered:
    04 Sep 2009
    07 Sep 2009
    Link to this post
    Hi,
    I'm trying to use AlternatingItemTemplate element of Repeater control in my ContentViewItemList.ascx template (for a custom Products module implementation). The problem is that the HyperLink controls (id=fullContent1 and id=fullContent2) inside AlternatingItemTemplate dont work as they do inside the ItemTemplate
    partial markup bellow:

    <asp:Repeater ID="repeater" runat="server">  
     <HeaderTemplate> 
            <table border="0" cellspacing="0" cellpadding="0" class="results_table">  
             <tr bgcolor="#234753" height="30px" > 
                <td width="25%" style="padding-left:10px;"><span>ANTEPRIMA</span></td>  
                <td width="53%"style="padding-left:10px;"><span>MODELLO</span></td>  
                <td width="22%"style="padding-left:10px;"><span>DETTAGLI</span></td>  
              </tr> 
              
        </HeaderTemplate> 
          
         
        <ItemTemplate> 
        <tr bgcolor="#b3cdd5">  
            <td class="results_row" style="padding-left:10px;"><asp:Image ID="imgThumb" runat="server"  /></td>  
            <td class="results_row" style="padding-left:10px;">  
                <asp:HyperLink ID="fullContent1" runat="server">  
                                <asp:Literal ID="Name" runat="server"></asp:Literal> 
                            </asp:HyperLink></td>  
            <td class="results_row" style="padding-left:10px;" align="center">  
            <asp:HyperLink ID="fullContent2" runat="server">  
                <asp:Image runat="server" ID="imgMod" ImageUrl="~/Images/modify_icon.png" /> 
            </asp:HyperLink> 
            </td> 
        </tr> 
          
        </ItemTemplate> 
        <AlternatingItemTemplate> 
         <tr bgcolor="#a5c0c8">  
            <td class="results_row" style="padding-left:10px;"><asp:Image ID="imgThumb" runat="server"  /></td>  
            <td class="results_row" style="padding-left:10px;"<asp:HyperLink ID="fullContent1" runat="server">  
                        <asp:Literal ID="Name" runat="server"></asp:Literal> 
                    </asp:HyperLink></td>  
            <td class="results_row" style="padding-left:10px;" align="center"><asp:Image runat="server" ID="imgMod" ImageUrl="~/Images/modify_icon.png" /></td>  
        </tr> 
          
        </AlternatingItemTemplate> 
          
          
        <FooterTemplate> 
        </table> 
              
              
        </FooterTemplate> 
    </asp:Repeater> 
     

    Do you have any suggestions,
    Thanks
  2. Cristian Grisolia
    Cristian Grisolia avatar
    6 posts
    Registered:
    04 Sep 2009
    10 Sep 2009
    Link to this post
    Sorry guys, my mistake here...
    my markup was missing an ending tag. Once I fixit, it all worked just fine

    Thanks and sorry again
2 posts, 0 answered