473,769 Members | 1,674 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

multiple <td> in a repeater control <ItemTemplate > (asp.net 2)

I would like to have multiple <td> in a repeater control. The below
code does not work:
<asp:Repeater ID="Repeater1" runat="server"
DataSourceID="S qlDataSource1" DataMember="Def aultView">
<HeaderTemplate >
<table>
</HeaderTemplate>
<tr>
<ItemTemplate >
<td>
<%#DataBinder.E val(Container.D ataItem, "itemname") %>
$<%#FormatNumbe r(DataBinder.Ev al(Container.Da taItem, "itemprice" ), 2)%>

<img src="images/<%#DataBinder.E val(Container.D ataItem,
"picfilename")% >">
<%#DataBinder.E val(Container.D ataItem, "itemdescriptio n")%>
<%#DataBinder.E val(Container.D ataItem, "itemaddtime")% >
</td>
</ItemTemplate>
</tr>
<FooterTemplate >
</table>
</FooterTemplate>
</asp:Repeater>

The problem with the above is the <tr>, if I take that out then that
page works. However this does not produce the disired results. I would
like to have more than five <td> in a <tr>, essentially wrapping the
<ItemTemplate > tag with <tr> tags and only repeating the <ItemTemplate >
five times.

Any help would be greatly appreciated,
Pete

Nov 19 '05 #1
3 2779
Pete,

If I understand you correctly, you want to have just one row and the
repeater items as cells? In this case you should use

<HeaderTemplate >
<table><tr>
</HeaderTemplate>

and

<FooterTemplate >
</tr></table>
</FooterTemplate>

Eliyahu

<we***********@ ebtech.net> wrote in message
news:11******** **************@ f14g2000cwb.goo glegroups.com.. .
I would like to have multiple <td> in a repeater control. The below
code does not work:
<asp:Repeater ID="Repeater1" runat="server"
DataSourceID="S qlDataSource1" DataMember="Def aultView">
<HeaderTemplate >
<table>
</HeaderTemplate>
<tr>
<ItemTemplate >
<td>
<%#DataBinder.E val(Container.D ataItem, "itemname") %>
$<%#FormatNumbe r(DataBinder.Ev al(Container.Da taItem, "itemprice" ), 2)%>

<img src="images/<%#DataBinder.E val(Container.D ataItem,
"picfilename")% >">
<%#DataBinder.E val(Container.D ataItem, "itemdescriptio n")%>
<%#DataBinder.E val(Container.D ataItem, "itemaddtime")% >
</td>
</ItemTemplate>
</tr>
<FooterTemplate >
</table>
</FooterTemplate>
</asp:Repeater>

The problem with the above is the <tr>, if I take that out then that
page works. However this does not produce the disired results. I would
like to have more than five <td> in a <tr>, essentially wrapping the
<ItemTemplate > tag with <tr> tags and only repeating the <ItemTemplate >
five times.

Any help would be greatly appreciated,
Pete

Nov 19 '05 #2
That is almost what I was looking for. I would like to have every five
records returned to be in their own set of <tr> tags so there would be
more than one set of <tr> tags.

Thanks again for your help,
Pete

Eliyahu Goldin wrote:
Pete,

If I understand you correctly, you want to have just one row and the
repeater items as cells? In this case you should use

<HeaderTemplate >
<table><tr>
</HeaderTemplate>

and

<FooterTemplate >
</tr></table>
</FooterTemplate>

Eliyahu

<we***********@ ebtech.net> wrote in message
news:11******** **************@ f14g2000cwb.goo glegroups.com.. .
I would like to have multiple <td> in a repeater control. The below
code does not work:
<asp:Repeater ID="Repeater1" runat="server"
DataSourceID="S qlDataSource1" DataMember="Def aultView">
<HeaderTemplate >
<table>
</HeaderTemplate>
<tr>
<ItemTemplate >
<td>
<%#DataBinder.E val(Container.D ataItem, "itemname") %>
$<%#FormatNumbe r(DataBinder.Ev al(Container.Da taItem, "itemprice" ), 2)%>

<img src="images/<%#DataBinder.E val(Container.D ataItem,
"picfilename")% >">
<%#DataBinder.E val(Container.D ataItem, "itemdescriptio n")%>
<%#DataBinder.E val(Container.D ataItem, "itemaddtime")% >
</td>
</ItemTemplate>
</tr>
<FooterTemplate >
</table>
</FooterTemplate>
</asp:Repeater>

The problem with the above is the <tr>, if I take that out then that
page works. However this does not produce the disired results. I would
like to have more than five <td> in a <tr>, essentially wrapping the
<ItemTemplate > tag with <tr> tags and only repeating the <ItemTemplate >
five times.

Any help would be greatly appreciated,
Pete


Nov 19 '05 #3
Then you need a datalist rather than a repeater. You can set it up to show 5
items in a row. And you don't need to care about table tags yourself, it
will do it for you.

Eliyahu

<we***********@ ebtech.net> wrote in message
news:11******** *************@g 47g2000cwa.goog legroups.com...
That is almost what I was looking for. I would like to have every five
records returned to be in their own set of <tr> tags so there would be
more than one set of <tr> tags.

Thanks again for your help,
Pete

Eliyahu Goldin wrote:
Pete,

If I understand you correctly, you want to have just one row and the
repeater items as cells? In this case you should use

<HeaderTemplate >
<table><tr>
</HeaderTemplate>

and

<FooterTemplate >
</tr></table>
</FooterTemplate>

Eliyahu

<we***********@ ebtech.net> wrote in message
news:11******** **************@ f14g2000cwb.goo glegroups.com.. .
I would like to have multiple <td> in a repeater control. The below
code does not work:
<asp:Repeater ID="Repeater1" runat="server"
DataSourceID="S qlDataSource1" DataMember="Def aultView">
<HeaderTemplate >
<table>
</HeaderTemplate>
<tr>
<ItemTemplate >
<td>
<%#DataBinder.E val(Container.D ataItem, "itemname") %>
$<%#FormatNumbe r(DataBinder.Ev al(Container.Da taItem, "itemprice" ), 2)%>
<img src="images/<%#DataBinder.E val(Container.D ataItem,
"picfilename")% >">
<%#DataBinder.E val(Container.D ataItem, "itemdescriptio n")%>
<%#DataBinder.E val(Container.D ataItem, "itemaddtime")% >
</td>
</ItemTemplate>
</tr>
<FooterTemplate >
</table>
</FooterTemplate>
</asp:Repeater>

The problem with the above is the <tr>, if I take that out then that
page works. However this does not produce the disired results. I would
like to have more than five <td> in a <tr>, essentially wrapping the
<ItemTemplate > tag with <tr> tags and only repeating the <ItemTemplate > five times.

Any help would be greatly appreciated,
Pete

Nov 19 '05 #4

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

Similar topics

1
2673
by: blugrasmaniac | last post by:
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>
3
1235
by: Matt Mercer | last post by:
Hi, I have an ASP .NET /VB application over a SQL database. I am designing a print friendly page. The database holds security incidents with the possibility of multiple (or none) people, and property attached to the incident. There is an incident table, person table, and property table all tied together by the incident number. When someone hits the print button I open a new page and use 3 datarepeaters to display the data. What happens...
5
4697
by: Ryan Moore | last post by:
I am trying to modify the onMouseOver attribute of a <td> cell created by a DataList... according to http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwebuiwebcontrolsdatagridclasstopic.asp "You can control the appearance of the DataGrid control by programmatically adding attributes to the <td> and <tr> tags rendered by the control on the browser. Attributes can be programmatically added by...
0
1171
by: info | last post by:
I have a datalist with ItemTemplate as a part of my control, however every time the ItemTemplate repeats, it inserts a <br>. How do I get it to not insert a <br>? I need it to be a DataList as opposed to a repeater so that I have access to the OnUpdateCommand. <asp:Panel id="DetailsPanel" runat="server"> <TABLE cellSpacing="0" cellPadding="0" width="100%" border="0"> <TR><TD><DIV align="center"><FONT color="black"...
1
6428
by: ratnakarp | last post by:
Hi, I have a search text box. The user enters the value in the text box and click on enter button. In code behind on button click i'm writing the code to get the values from the database and binding it to a repeater control. This repeater control has multiple text boxes and buttons. Can you please tell me how can i do paging in this case ? I'm posting my code below. The problem is that if i click on "AdjustThisAd" button, it opens...
2
12668
by: deathtospam | last post by:
Is it possible to Databind to a strongly-typed list of integers (List<int>) ? I want to use <%# Databinder.Eval(Container.DataItem, "XXX") %inside a Repeater control in my ASPX page, but I don't know how to get at the List<intvalue. -= Tek Boy =-
0
1542
by: joelgarcia007 | last post by:
I really hope someone can help me with this because it's really driving me crazy. I need to dynamically display multiple data tables on a page so I am using a Repeater to do so and in the ItemTemplate of the Repeater I am adding a Gridview control. One of the columns of the GridView control is a TemplateColumn that contains an ImageButton. The tricky thing is that I am using .NET 2.0 and it seems that I have to register this control (I'm...
4
15482
by: Michael | last post by:
I have a repeater web control. Currently I want to change some row's color based on defined condition. Is there any code sample demonstrating how to accomplish it? Thanks.
12
2181
by: =?Utf-8?B?Qi4gQ2hlcm5pY2s=?= | last post by:
I'm doing a web app in VB/Dot Net 2.0. I'm probably a bit rusty and I have no experience using the repeater control. I have a user control I've created with multiple properties. I've created a test page and I've managed to bind the usercontrol to a repeater and display some data in the following fashion: <asp:Repeater ID="Repeater1" runat="server" DataSourceID="ObjectDataSource1"> <ItemTemplate > <uc1:AUserControl runat="server"...
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10211
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9863
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8870
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7408
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6673
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
3561
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.