I'm trying to access the value of a selected radioButton. I have a list of radio button's seperated by sub headers (hence why i havent used a radioList)
I don't know how to access the selected value as i'm not sure what name it's given with it being dynamic.
The following code is in a for loop and outputs radio options. All the options are for one required user selection.
//add list to radio button list
RadioButton button1 = new RadioButton {
GroupName = "myGroup",
Text = singleType.appTypeName,
ID = singleType.appTypeID.ToString()
};
radioArea.Controls.Add(button1);
myLabel = new Label();
myLabel.Text = "<br />";
radioArea.Controls.Add(myLabel);
This is how im trying to access it:
RadioButton myButton = (RadioButton) radioArea.FindControl("myGroup");
I realise this should be very simple but im still in a very much PHP mindset and appreciate any help.
Thanks