radiobutton not working in allkeys
- by gerred
i have a radiobutton built throught my code. this is the code for that.
dim 1 as intereger = 0
Dim rd As New RadioButton
rd.ID = "rd_" & i
rd.GroupName = "rd_g"
TD.Controls.Add(rd)
i = i+1
the reason i gave groupname is so that when i select the radiobutton only one is selected at one time and not all. but this creates a problem in my save button. here's the code for that -
For Each key As String In Request.Form.AllKeys
If key.Contains("rd_") Then
Dim temp1 As String = key.Substring(key.IndexOf("rd_")).Replace("rd_", "")
Dim id As Integer = Val(temp)
If id 0 Then
SQL = "select .... "
In the Request.Form.AllKeys I only get the groupname and not the ID of the radiobutton that i need.
what am i doing wrong?