title: groupname doesn't work in more than one radiobutton inside repeater asp.net
body: <p>I have a repeater and inside the repeater a radiobutton control, in code behind I fill the groupname for the radiobutton control, so, when I run it, I have a table with many rows and some of them have radiobutton:</p>
  
  <pre><code>  &lt;asp:updatepanel id="UpdatePanel1" runat="server" updatemode="Conditional"&gt;
      &lt;ContentTemplate&gt;
          &lt;asp:Repeater ID="Repeater1" runat="server" ViewStateMode="Enabled"&gt;
              &lt;HeaderTemplate&gt;
                  &lt;table class="table table-responsive table-bordered "&gt;
                      &lt;tr class="text-center" style="background-color: #6e6259; color: white;"&gt;
                          &lt;th class="text-center"&gt;DESCRIPTION&lt;/th&gt;
  &lt;/HeaderTemplate&gt;
              &lt;ItemTemplate&gt;
           &lt;tr&gt;
          &lt;td style="padding-left: 20px;"&gt;
        &lt;asp:RadioButton ID="rbtDinamic"  OnCheckedChanged="rbtDinamic_CheckedChanged" AutoPostBack="true"
             ViewStateMode="Enabled" Visible="false"  GroupName='&lt;%#Eval("groupvalue") %&gt;'   runat="server"/&gt;&lt;/td&gt;
  &lt;/ItemTemplate&gt;
        &lt;FooterTemplate&gt;
      &lt;/table&gt;
       &lt;/FooterTemplate&gt;
      &lt;/asp:Repeater&gt;
       &lt;/ContentTemplate&gt;
        &lt;/asp:UpdatePanel&gt;
  </code></pre>
  
  <p>And in the itemdatabound of repeater I fill the value for groupname:</p>
  
  <pre><code>  Private Sub Repeater1_ItemDataBound(sender As Object, e As RepeaterItemEventArgs) Handles Repeater1.ItemDataBound
      Try
          If e.Item.ItemType = ListItemType.AlternatingItem Or e.Item.ItemType = ListItemType.Item Then
              If CType(e.Item.FindControl("hdf1"), Label).Text = False Then
                  CType(e.Item.FindControl("rbtDinamic"), RadioButton).Visible = True
                  CType(e.Item.FindControl("rbtDinamic"), RadioButton).GroupName = CType(e.Item.FindControl("groupvalue"), Label).Text = False
              End If
          End If
      Catch ex As Exception          
      End Try
  End Sub
  </code></pre>
  
  <p>But when I run it the repeater creates the group name with diferent names:</p>
  
  <pre><code>Radiobutton row 1:
  Repeater1$ctl05$1
  
  Radiobutton row 2:
  
  Repeater1$ctl06$1
  </code></pre>
  
  <p>So it let checked all the radiobuttons, instead to uncheck when another one for the same group is cheked.</p>
  
  <p>I find this code in a forum, but it work only if I have only one groupname, but I can have more than one groupname:</p>
  
  <pre><code>  Protected Sub rbtDinamic_CheckedChanged(sender As Object, e As EventArgs)
      For Each item As RepeaterItem In Repeater1.Items
          Dim rbtn As RadioButton = DirectCast(item.FindControl("rbtDinamic"), RadioButton)
          rbtn.Checked = False
      Next
      DirectCast(sender, RadioButton).Checked = True
  End Sub
  </code></pre>
  
  <p>But there can be more than one group of radiobuttons, so in this case I can't use this code.</p>
  
  <p>Is there anywhere to do this? thanks</p>