RepeaterTemplates and dynamic ControlIDs

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello
Im trying to develop a nested repeatertemplate, Im trying to create a
template in the following way:
Repeater r = new Repeater();
r.ID = "Repeater0";

// r.HeaderTemplate = new GroupHeaderItemTemplate("");
r.HeaderTemplate = LoadTemplate("GroupHeader.ascx");
r.ItemTemplate = LoadTemplate("GroupItem.ascx");
r.FooterTemplate = LoadTemplate("GroupFooter.ascx");

The ItemTemplate should contains another Repeater which in turns should
contain another Repeater and so forth.
snippet from the GroupItem.ascx:
...."<asp:Repeater ID="Repeater2" runat="server">

<HeaderTemplate>
<table>
<tr>
<td>CID</td><td>Date</td>
</tr>

</HeaderTemplate>
<ItemTemplate>
<tr>
<td><%# DataBinder"....
But to use the same UserControls I need to be able to change the RepeaterID
in there, but I get an error:
"Error 3 The ID property of a control can only be set using the ID attribute
in the tag and a simple value. Example: <asp:Button runat="server"
id="Button1" /> "

This is logically IMHO, but how do I manage my problem then??

Kind regards
 
Hello... just me again :-)

Never mind my posting!

I can accomplish the same thing with a dynamic template.

Cheers...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top