I have question about why 2 controls in separate repeaters cannot have the same ID if they are within an update panel, but they can share the same ID if they are not in an update panel. See this code...
<asp:Repeater ID="rptFirstRepeater" runat="server">
<ItemTemplate>
<asp:Image runat="server" ID="imgThisWorks" />
<asp:UpdatePanel runat="server">
<ContentTemplate>
<asp:Image runat="server" ID="imgThisDoesntWork" />
</ContentTemplate>
</asp:UpdatePanel>
</ItemTemplate>
</asp:Repeater>
<asp:Repeater ID="rptSecondRepeater" runat="server">
<ItemTemplate>
<asp:Image runat="server" ID="imgThisWorks" />
<asp:UpdatePanel runat="server">
<ContentTemplate>
<asp:Image runat="server" ID="imgThisDoesntWork" />
</ContentTemplate>
</asp:UpdatePanel>
</ItemTemplate>
</asp:Repeater>
Generates this error:
CS0102: The type 'ASP._8_admin_testemail_aspx' already contains a definition for 'imgThisDoesntWork'
But it works fine if you don't use the update panel, like so.
<asp:Repeater ID="rptFirstRepeater" runat="server">
<ItemTemplate>
<asp:Image runat="server" ID="imgThisWorks" />
</ItemTemplate>
</asp:Repeater>
<asp:Repeater ID="rptSecondRepeater" runat="server">
<ItemTemplate>
<asp:Image runat="server" ID="imgThisWorks" />
</ItemTemplate>
</asp:Repeater>
I understand that all controls within repeaters are given new ids something lke... ctl00_cttBody_ucTestControl_rptFirstRepeater_ctl00_imgThisWorks
Does this not apply to the update panel as well? Would I be able to make the code above work using the same IDs? - please ignore the fact that these 2 repeaters should really be one repeater! :)
Thanks, charles.