473,406 Members | 2,345 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.

Reusing a asp:repeater?

Greetings,

I am using a user control to do the work, and have figured most of it
out so far, cept the below:

I am currently trying to do the following:

- query to get a count of items in a db
- for each item, query a different table and display results

So far I am able to query the table and display one set of results, but
I need to be able to add in the initial query to get count and then
have a repeater display (x) amount of times.

For example:

Item 1
ID Data
1001 Blah Blah
1002 Blah Blah

Item 2
ID Data
1001 Blah Blah
1002 Blah Blah

Right now I am able to have 1 item work with hardcoding criteria...but
the above is what I need for it to do.

Thanks in advance!

May 27 '06 #1
1 1374
I am very close..Right now it works, but it only shows me 1 entry,
where there should be 2 different repeaters showing information:

for (int i = 0; i <
dsSites.Tables["ar_sites_table"].Rows.Count; i++)
{
siteCode =
dsSites.Tables["ar_sites_table"].Rows[i]["site_code"].ToString();
siteName =
dsSites.Tables["ar_sites_table"].Rows[i]["site_name"].ToString();
siteID =
dsSites.Tables["ar_sites_table"].Rows[i]["site_id"].ToString();
addLink = "dsp_CampaignsAdd.aspx?=" + siteID;

string query = "SELECT * FROM " + siteCode +
"_campaign_table ORDER BY campaign_name";

myRepeater.ID = "myRepeater" + i.ToString();
myRepeater.DataSource = fetchData(query);
myRepeater.DataBind();

PlaceHolder1.Controls.Add(myRepeater);

PlaceHolder1.Controls.Add(new LiteralControl("<br />"));
}

Any thoughts on how to dynamically display the correct number of user
controls? In this case repeaters...

May 28 '06 #2

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

Similar topics

0
by: Joe Fawcett | last post by:
I'm having a problem binding an asp:repeater control to a Hashtable. Originally my code was: <asp:Repeater id="rptFamily" runat="server" DataSource="<%# family %>"> <ItemTemplate> <%#...
5
by: Scott Lyon | last post by:
I am having a strange problem. The program is a bit complex, but I'll try to simplify what I can. I apologize if this is complicated, but I think this would still be simpler than posting a bunch of...
3
by: Joe Fawcett | last post by:
Sorry about the multi post, I thought I'd sent to both groups simultaneously but somehow it failed to find this one the first time. I'm having a problem binding an asp:repeater control to a...
1
by: Timbo | last post by:
Hi all, This is my first message here so i'll try and include all the information that will help you help me out, if possible. Basically I am using C# in ASP.NET 2.0 and have a Repeater...
2
by: bissatch | last post by:
Hi, I am trying to output a list of checkboxes. Using ASP .NET controls, I was able to create the following: <label for="colour_red">Red: </label><asp:CheckBox ID="colour_red" runat="server"...
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...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...
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.