ASP.NET Setting HtmlInputRadioButton name in GridView from code behind
<p>On the <code>RowDataBound</code> event of a gridview I am setting the name of the <code>HtmlInputRadioButton</code> inside the <code>GridViewRow</code>. The problem is that asp.net automatically makes the name unique therefore ungrouping the radio buttons. </p>

<p>Is there a way that I disable this?</p>

<p>Edit -
Here's how I am setting the name:</p>

<pre><code>  Private Sub gvFoo_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles gvSecPos.RowDataBound
If Not (e.Row.RowType = DataControlRowType.DataRow) OrElse (e.Row.Cells(0) Is Nothing) Then
  Return
End If
Dim drFoo As DataRowView = CType(e.Row.DataItem, DataRowView)

Dim rbFoo As HtmlInputRadioButton = CType(e.Row.FindControl("rbFoo"), HtmlInputRadioButton)
rbFoo.Name = "Foo" 'ASP.NET makes this unique which I do not want
rbFoo.Value = "A Value"

  End Sub
</code></pre>

<p>Produces this html</p>

<pre><code>&lt;input type="radio" id="ctl00_ContentPlaceHolder1_ucFoo_gvFoo_ctl06_rbFoo" name="ctl00$ContentPlaceHolder1$ucFoo$gvFoo$ctl06$Foo" value="A Value"&gt;

&lt;input type="radio" id="ctl00_ContentPlaceHolder1_ucFoo_gvFoo_ctl07_rbFoo" name="ctl00$ContentPlaceHolder1$ucFoo$gvFoo$ctl07$Foo" value="A Value"&gt;
</code></pre>

<p>Instead of </p>

<pre><code>&lt;input type="radio" id="ctl00_ContentPlaceHolder1_ucFoo_gvFoo_ctl06_rbFoo" name="Foo" value="A Value"&gt;

&lt;input type="radio" id="ctl00_ContentPlaceHolder1_ucFoo_gvFoo_ctl07_rbFoo" name="Foo" value="A Value"&gt;
</code></pre>

<p>Due to the numbers "106" and "107" in the name of the respective radiobuttons it ungroups them.</p>
