Multiple Template Tags within repeater?

Discussion in 'ASP .Net' started by blugrasmaniac, Oct 15, 2003.

  1. I have discovered that within a <ASP:REPEATER> control, I can specify
    multiple tags, such as <ItemTemplate> and <AlternatingItemTemplate>.

    So that I could write code like following:

    <asp:Repeater id="XRefResultsRepeater" runat="server">
    <HeaderTemplate>
    <tr class="heading"><td>Blah blah</td></tr>
    </HeaderTemplate>

    <ItemTemplate>
    <tr bgcolor="white">
    </ItemTemplate>

    <AlternatingItemTemplate>
    <tr bgcolor="lightgoldenrodyellow">
    </AlternatingItemTemplate>

    <ItemTemplate>
    <td><%#DataBinder.Eval(Container.DataItem, "blah")%></td>
    </tr>
    </ItemTemplate>
    </asp:Repeater>


    It appears to work wonderfully and saves much repeated code when all I
    wish to is alternate the BGColor of the Table Row <TR> tag and many
    columns <TD> are involved.

    I can't find this documented, though...does anyone know if this
    technique is something that I can safely practice??

    Thanks,
    JOEG
     
    blugrasmaniac, Oct 15, 2003
    #1
    1. Advertising

  2. never mind......and for the record - It doesn't work quite as described after all!



    (blugrasmaniac) wrote in message news:<>...
    > I have discovered that within a <ASP:REPEATER> control, I can specify
    > multiple tags, such as <ItemTemplate> and <AlternatingItemTemplate>.
    >
    > So that I could write code like following:
    >
    > <asp:Repeater id="XRefResultsRepeater" runat="server">
    > <HeaderTemplate>
    > <tr class="heading"><td>Blah blah</td></tr>
    > </HeaderTemplate>
    >
    > <ItemTemplate>
    > <tr bgcolor="white">
    > </ItemTemplate>
    >
    > <AlternatingItemTemplate>
    > <tr bgcolor="lightgoldenrodyellow">
    > </AlternatingItemTemplate>
    >
    > <ItemTemplate>
    > <td><%#DataBinder.Eval(Container.DataItem, "blah")%></td>
    > </tr>
    > </ItemTemplate>
    > </asp:Repeater>
    >
    >
    > It appears to work wonderfully and saves much repeated code when all I
    > wish to is alternate the BGColor of the Table Row <TR> tag and many
    > columns <TD> are involved.
    >
    > I can't find this documented, though...does anyone know if this
    > technique is something that I can safely practice??
    >
    > Thanks,
    > JOEG
     
    blugrasmaniac, Oct 16, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Michael Wendel
    Replies:
    2
    Views:
    1,033
    Michael Wendel
    Sep 6, 2005
  2. Ranganath

    Custom Tags within Custom Tags.

    Ranganath, Oct 17, 2003, in forum: Java
    Replies:
    2
    Views:
    479
    Ranganath
    Oct 21, 2003
  3. Kwasi
    Replies:
    13
    Views:
    611
    Kwasi Yeboah via JavaKB.com
    Dec 1, 2004
  4. Chris

    table-tags within div-tags

    Chris, Feb 9, 2004, in forum: HTML
    Replies:
    5
    Views:
    13,328
    Chris
    Feb 10, 2004
  5. Donald Firesmith

    html tags within meta tags allowed?

    Donald Firesmith, Jan 5, 2005, in forum: XML
    Replies:
    5
    Views:
    933
    Andy Dingley
    Jan 8, 2005
Loading...

Share This Page