multiple datarepeater

  • Thread starter Thread starter suzy
  • Start date Start date
S

suzy

hello,

how can i have multiple datarepeaters on the same aspx page?

i have tried something similar to this:

<asp:repeater id="repeater1" runat="server">
<itemtemplate>
<td>text</td>
</itemtemplate>
</asp:repeater>

<asp:repeater id="repeater2" runat="server">
<itemtemplate>
<td>other text</td>
</itemtemplate>
</asp:repeater>

all i want is for my page to print out all the items of repeater1, then
print out all the values of repeater2. but at the moment, my page is print
out all the values of repeater1, then all the items of repeater2, then it's
doing the entire thing again. :(

thanks in advance
 
But I have a different dataset for each repeater. And each dataset contains
only 1 table. It's printing the values fine, just the entire thing 2 times
in a row.
 
Hi suzy,

post the code behind and the aspx snip where you declare the repeaters

Cheers,
 
I dont have the code on me, and it's nothing fancy, but it's something like
this:

protected Repeater repRepeater1;
protected Repeater repRepeater2;
....
....

Page_Load()
{
repRepeater1.DataSource = dt; //this is a single table (data dable)
containing the data i want to display 1st
repRepeater1.DataBind();

repRepeater2.DataSource = dt2; //this is a single table (data dable)
containing the data i want to display 2nd
repRepeater1.DataBind();
}
 
Back
Top