radiobutton not working in allkeys
Posted
by gerred
on Stack Overflow
See other posts from Stack Overflow
or by gerred
Published on 2010-03-16T20:40:13Z
Indexed on
2010/03/16
22:51 UTC
Read the original article
Hit count: 578
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?
© Stack Overflow or respective owner