473,406 Members | 2,369 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Multiple Template Tags within repeater?

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
Nov 17 '05 #1
1 2646
never mind......and for the record - It doesn't work quite as described after all!

jo****@mailinator.com (blugrasmaniac) wrote in message news:<58**************************@posting.google. 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

Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: .Net Newbie | last post by:
I am relatively new to .Net and have been coding an intranet site for my employer for a couple of months. I am currently stuck coding in a text-editor called EditPlus without access to the VS.Net...
3
by: Trapulo | last post by:
I've a datarepeater that loads custom external templates with loadtemplate and bind data to them. All ok. Now I need to localize some text labels, but I don't know how can I change this data. If I...
1
by: Mike | last post by:
Hi! Been stuck on this one for a bit. Would really appreciate any help on this one. To start. I have a sql database table with the following data and design (ex) ...
2
by: Antoine | last post by:
I would like to construct my own list of items in a grid/ table/ item list layout but I have a problem. I want to add a sort of index row based on time, such as there might be blank values. Sure...
3
by: Andy Fish | last post by:
Hi, Say I had a repeater-like situation but were I wanted to have every 3rd item look different instead of every alternating one. I could write my own custom control and in the ASPX file...
3
by: webserverpete | last post by:
I would like to have multiple <td> in a repeater control. The below code does not work: <asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource1" DataMember="DefaultView">...
0
by: Gordon Smith | last post by:
Hi, Am writing a server control which contains a repeater control. I followed the code outlined by Rachel@discussions.microsoft.com (many thanks) on the following thread: ...
6
by: Neal | last post by:
Hi All, I used an article on XSLT and XML and creating a TOC written on the MSDN CodeCorner. ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.1033/dncodecorn/html/corner042699.htm However, it did'nt...
8
by: fernandezr | last post by:
I would like to use a user control as a template inside a repeater. Some of the fields in the control should be hidden depending on whether or not there is data. I'm still a ASP .Net newbie so the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.