title: two components with the same id can't be added to the application
body: <p>Hello I am having problems with 2 popupcontrol extenders.  They are used in conjuction with a webservice to display the detail information from a database.  Each extender gets information a from 2 different tables.  The extenders both work fine except when they have run across a row that has the same primary key number.  Here is what the code is (I removed most of the info) to hopefully make it faster to view:</p>
  
  <pre><code>&lt;cc1:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="0" CssClass="ajax__myTab" Width="100%" ScrollBars="Horizontal"&gt;
      &lt;cc1:TabPanel ID="TabPanel5" runat="server" HeaderText="" Enabled="true"&gt;
          &lt;HeaderTemplate&gt;Agent Info &lt;/HeaderTemplate&gt;
          &lt;ContentTemplate&gt;
          &lt;asp:GridView ID="GridViewClosedProducts" runat="server" AutoGenerateColumns="False" 
              BackColor="White" BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px" 
              CellPadding="5" CellSpacing="1" DataKeyNames="Pkey" 
              DataSourceID="SqlDataSourceGRClosedProds" ForeColor="Black" GridLines="Vertical" 
              AllowSorting="True" PageSize="20"&gt;
              &lt;FooterStyle BackColor="#CCCCCC" /&gt;
              &lt;Columns&gt;
                  &lt;asp:TemplateField&gt;
                      &lt;ItemTemplate&gt;
                          &lt;asp:Image runat="server" BorderStyle="None" ID="Image1" ImageUrl="Images\MagnifyingClass.gif" /&gt;
                          &lt;cc1:PopupControlExtender ID="PopupControlExtender1" runat="server" PopupControlID="Panel1" TargetControlID="Image1" DynamicContextKey='&lt;%# Eval("Pkey") %&gt;' DynamicControlID="Panel1" DynamicServiceMethod="GetClosedComment" Position="right"&gt;
                          &lt;/cc1:PopupControlExtender&gt;
                          &lt;asp:Panel ID="Panel1" runat="server"&gt;
                          &lt;/asp:Panel&gt;
                      &lt;/ItemTemplate&gt;
                      &lt;HeaderStyle VerticalAlign="Top" BorderWidth="0px" /&gt;
                      &lt;ItemStyle BorderWidth="0px" HorizontalAlign="Center" /&gt;
                  &lt;/asp:TemplateField&gt;
              &lt;/Columns&gt;
              &lt;PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" /&gt;
              &lt;SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" /&gt;
              &lt;HeaderStyle BackColor="Silver" Font-Bold="True" ForeColor="Black" /&gt;
              &lt;AlternatingRowStyle BackColor="#CCCCCC" /&gt;
          &lt;/asp:GridView&gt;
          &lt;asp:SqlDataSource ID="SqlDataSourceGRClosedProds" runat="server" 
              ConnectionString="&lt;%$ ConnectionStrings:EUCNET00722 %&gt;" 
              SelectCommand="SELECT * FROM [tblClosedProducts] WHERE ([AgentMainPkey] = @AgentMainPkey) ORDER BY Product, DateClosed"&gt; 
              &lt;SelectParameters&gt;
                  &lt;asp:ControlParameter ControlID="hdnPkey" Name="AgentMainPkey" PropertyName="Value" Type="Int32" /&gt;
             &lt;/SelectParameters&gt;
          &lt;/asp:SqlDataSource&gt;
  &lt;/ContentTemplate&gt;
  &lt;/cc1:TabPanel&gt;
  
      &lt;cc1:TabPanel ID="TabPanel3" runat="server" HeaderText="" Enabled="true"&gt;
          &lt;HeaderTemplate&gt;Agent Info &lt;/HeaderTemplate&gt;
          &lt;ContentTemplate&gt;
  &lt;asp:GridView ID="GridViewUpdates" runat="server" AutoGenerateColumns="False" BackColor="White" 
      BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px" CellPadding="5" 
      CellSpacing="1" DataKeyNames="Pkey" DataSourceID="SqlDataSourceGRUpdates" ForeColor="Black" 
      GridLines="Vertical"&gt;
      &lt;AlternatingRowStyle BackColor="#CCCCCC" /&gt;
      &lt;Columns&gt;
          &lt;asp:TemplateField&gt;
              &lt;ItemTemplate&gt;
                   &lt;asp:Image runat="server" BorderStyle="None" ID="Image1" ImageUrl="Images\MagnifyingClass.gif" /&gt;
                  &lt;cc1:PopupControlExtender ID="PopupControlExtenderGVU" runat="server" PopupControlID="Panel1" TargetControlID="Image1" DynamicContextKey='&lt;%# Eval("Pkey") %&gt;' DynamicControlID="Panel1" DynamicServiceMethod="GetUpdateComment" Position="right"&gt;
                  &lt;/cc1:PopupControlExtender&gt;
                  &lt;asp:Panel ID="Panel1" runat="server"&gt;
                  &lt;/asp:Panel&gt;
              &lt;/ItemTemplate&gt;
              &lt;HeaderStyle VerticalAlign="Top" BorderWidth="0px" /&gt;
              &lt;ItemStyle BorderWidth="0px" HorizontalAlign="Center" /&gt;
          &lt;/asp:TemplateField&gt;
      &lt;/Columns&gt;
     &lt;FooterStyle BackColor="#CCCCCC" /&gt;
      &lt;HeaderStyle BackColor="Silver" Font-Bold="True" ForeColor="Black" /&gt;
     &lt;PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" /&gt;
     &lt;SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" /&gt;
  &lt;/asp:GridView&gt;
  &lt;asp:SqlDataSource ID="SqlDataSourceGRUpdates" runat="server" ConnectionString="&lt;%$ ConnectionStrings:EUCNET00722 %&gt;" SelectCommand="SELECT * FROM [tblComments] WHERE ([AgentMainPkey] = @AgentMainPkey) ORDER BY DateOfComment DESC" DeleteCommand="delete from tblComments where pkey = @pkey"&gt;
      &lt;SelectParameters&gt;
          &lt;asp:ControlParameter ControlID="hdnPkey" Name="AgentMainPkey" PropertyName="Value" Type="Int32" /&gt;
      &lt;/SelectParameters&gt;
  &lt;/asp:SqlDataSource&gt;
  &lt;/ContentTemplate&gt;
  &lt;/cc1:TabPanel&gt;
  &lt;/cc1:TabContainer&gt;
  </code></pre>
  
  <p>** Code behind</p>
  
  <pre><code>Protected Sub GridViewClosedProducts_RowCreated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridViewClosedProducts.RowCreated
  
      If e.Row.RowType = DataControlRowType.DataRow Then
  
          If Not e.Row.DataItem Is Nothing Then
  
              Dim pce As PopupControlExtender = TryCast(e.Row.FindControl("PopupControlExtender1"), PopupControlExtender)
  
              Dim MyPkey As String = e.Row.DataItem("Pkey")
              pce.BehaviorID = MyPkey
  
              Dim img As Image = DirectCast(e.Row.FindControl("Image1"), Image)
  
              Dim OnMouseOverScript As String = String.Format("$find('{0}').showPopup();", MyPkey)
              Dim OnMouseOutScript As String = String.Format("$find('{0}').hidePopup();", MyPkey)
  
              img.Attributes.Add("onmouseover", OnMouseOverScript)
              img.Attributes.Add("onmouseout", OnMouseOutScript)
  
          End If
  
      End If
  
   End Sub
  
  
  Protected Sub GridViewUpdates_RowCreated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridViewUpdates.RowCreated
  
      If e.Row.RowType = DataControlRowType.DataRow Then
  
          If Not e.Row.DataItem Is Nothing Then
              Dim pceGVU As PopupControlExtender = TryCast(e.Row.FindControl("PopupControlExtenderGVU"), PopupControlExtender)
  
              Dim MyPkey As String = e.Row.DataItem("Pkey")
              pceGVU.BehaviorID = MyPkey
  
              Dim img As Image = DirectCast(e.Row.FindControl("Image1"), Image)
  
              Dim OnMouseOverScript As String = String.Format("$find('{0}').showPopup();", MyPkey)
              Dim OnMouseOutScript As String = String.Format("$find('{0}').hidePopup();", MyPkey)
  
              img.Attributes.Add("onmouseover", OnMouseOverScript)
              img.Attributes.Add("onmouseout", OnMouseOutScript)
  
          End If
  
      End If
  
  End Sub
  </code></pre>
  
  <p>This is how the code is rendered by IE</p>
  
  <pre><code>&lt;img id="ctl00_ContentPlaceHolder2_TabContainer1_TabPanel5_GridViewClosedProducts_ctl10_Image1" onmouseover="$find('48').showPopup();" onmouseout="$find('48').hidePopup();" src="Images\MagnifyingClass.gif" style="border-style:None;border-width:0px;" /&gt;
  &lt;img id="ctl00_ContentPlaceHolder2_TabContainer1_TabPanel3_GridViewUpdates_ctl02_Image1" onmouseover="$find('48').showPopup();" onmouseout="$find('48').hidePopup();" src="Images\MagnifyingClass.gif" style="border-style:None;border-width:0px;" /&gt;
  </code></pre>