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
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