How to know the ordinal position of an ItemTemplate

Posted by Gaizka on Stack Overflow See other posts from Stack Overflow or by Gaizka
Published on 2009-01-21T08:57:56Z Indexed on 2010/04/03 6:23 UTC
Read the original article Hit count: 411

Filed under:
|
|

Need to add styles (class="bBot") to the first ItemTemplate item, how do I know it's the first?

<asp:Repeater id="ArticlesRepeater" runat="server">
    <HeaderTemplate>
        <div class="FR boxW380">
            <div class="cnt mag">
             <div class="FR">
                    <a href="#">Subscribe</a>
                    &#160; &#160;
                    <a href="#">Archive</a>
             </div>
             <h1>Magazine</h1>
    </HeaderTemplate>

    <ItemTemplate>
                <div>
                    <a href="#">
                        <img class="visu" alt=""
                            src="<%# DataBinder.Eval(Container.DataItem, "image") %> " />
                        <span class="title">
                            <%# DataBinder.Eval(Container.DataItem, "title") %>
                        </span>
                        <span class="content">
                            <%# DataBinder.Eval(Container.DataItem, "shortintroduction")%>
                        </span>
                    </a>
                    <div class="CB"></div>
                </div>
    </ItemTemplate>

    <FooterTemplate>
            </div>
        </div>
    </FooterTemplate>
</asp:Repeater>

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about repeater