Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Multiple Template Tags within repeater?

Reply
Thread Tools

Multiple Template Tags within repeater?

 
 
blugrasmaniac
Guest
Posts: n/a
 
      10-15-2003
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
 
Reply With Quote
 
 
 
 
blugrasmaniac
Guest
Posts: n/a
 
      10-16-2003
never mind......and for the record - It doesn't work quite as described after all!



http://www.velocityreviews.com/forums/(E-Mail Removed) (blugrasmaniac) wrote in message news:<(E-Mail Removed). com>...
> 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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
c# webapp template - how to custom a template so it automatically adds files within directories? ddfsdf ASP .Net 0 10-11-2005 02:47 PM
html tags within meta tags allowed? Donald Firesmith XML 5 01-08-2005 11:29 PM
Unable to have tags within tags?? Kwasi Java 13 12-01-2004 02:57 PM
table-tags within div-tags Chris HTML 5 02-10-2004 08:57 PM
Custom Tags within Custom Tags. Ranganath Java 2 10-21-2003 06:14 AM



Advertisments