473,382 Members | 1,736 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,382 software developers and data experts.

repeater output

I have a query that spits out a single column of text rows. For example,

City
"London"
"New York"
"Toronto"
"Chicago"

I have a repeater that I'd like to use to spit out the output as
follows:

London, New York, Toronto, Chicago

How do I do that?? I use a repeater because I am using multiple nested
repeaters, datasets and relations to display "merged" output from
multiple queries. All works fine except for the city listing..

I get London, New York, Toronto, Chicago, (noticed the extra comma at
the end).

Repeater code is as follows

<asp:Repeater ID="cityList" Runat="server" DataSource='fasd'>
<ItemTemplate>
<%# Container.DataItem("city") %>,
</ItemTemplate>
</asp:Repeater>

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #1
1 1068
You're on the right track. However, the repeater is doing exactly what you
told it to do (including adding the comma at the end of every item). Try
this instead:

<asp:Repeater ID="cityList" Runat="server" DataSource='fasd'>
<ItemTemplate>
<%# Container.DataItem("city") %>
</ItemTemplate>
<SeparatorTemplate>
,
</SeparatorTemplate>
</asp:Repeater>

Note that I removed the comma from the ItemTemplate and added a
SeparatorTemplate. The SeparatorTemplate will render between items.

--
Ben Lucas
Lead Developer
Solien Technology, Inc.
www.solien.com
"Bijoy Naick" <b_*****@donoteamil.yahoo.ca> wrote in message
news:O6**************@TK2MSFTNGP11.phx.gbl...
I have a query that spits out a single column of text rows. For example,

City
"London"
"New York"
"Toronto"
"Chicago"

I have a repeater that I'd like to use to spit out the output as
follows:

London, New York, Toronto, Chicago

How do I do that?? I use a repeater because I am using multiple nested
repeaters, datasets and relations to display "merged" output from
multiple queries. All works fine except for the city listing..

I get London, New York, Toronto, Chicago, (noticed the extra comma at
the end).

Repeater code is as follows

<asp:Repeater ID="cityList" Runat="server" DataSource='fasd'>
<ItemTemplate>
<%# Container.DataItem("city") %>,
</ItemTemplate>
</asp:Repeater>

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 18 '05 #2

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

Similar topics

1
by: Henry Nelson | last post by:
Hi all I'm very new to dotNet and just trying to get my head around the right way to do the thing that I would normally do in asp. In asp I would loop through a recordset and output all the...
1
by: Pitcairnia | last post by:
We have been using a repeater to spit out images to a page and our seperator is simply a non-breaking space. This is the style we need because it adjusts nicely for the users resolution and width...
7
by: gemel | last post by:
I am developing an application that uses SQL 2000 as my source of images. I have successfully created the code to load the images onto the SQL Server and also to retrieve the images into a dataset....
0
by: tenaka2k | last post by:
OK I have poked around and have not found an answer to my problem . I have a repeater that in it's <ItemTemplate> calls a function I want to pass the current values from the repeater to the...
0
by: Howard | last post by:
I need to generated a list from data from 2 database tables. 1st list CATEGORY consists of columns CATID|CATEGORYNAME| 2nd table ITEM has columns ID|CATEGORYID|NAME| <asp:repeater id=parent...
2
by: Mike Cain | last post by:
Hi, The Repeater control seems like exactly what I want to output rows of data from my database. However I need to do some manipulation to the data prior to it being output and I'm not...
1
by: jazzart | last post by:
Hi there, I'm fairly new to programming with Asp.Net 2.0 so I'm finding myself regularly fumbling around in the dark a bit, so to speak. I'm currently using Visual Web Developer and have been...
3
by: Emma Middlebrook | last post by:
Hi there, I've been trying to implement a repeater control in an ASP.NET 2 page but I can't seem to get the layout exactly how I want and I'm not sure if it's something that I am doing wrong or...
12
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.