I have an HTML table that I populate programmatically in the code behind.
One of the table has a radio button.
How can I get the value of that radio button ?
This is my code. I try to get the value of the radio button in cmdSubmit_Click.
Thank you.
tempRow = new TableRow();
tempCell = new TableCell();
RadioButton element2 = new RadioButton();
element2.Text = "Off";
tempCell.Controls.Add(element2);
tempRow.Cells.Add(tempCell);
myTbl.Rows.Add(tempRow);
protected void cmdSubmit_Click(object sender, EventArgs e)
{
for (int y = 1; y <= tblExchange.Rows.Count - 1; y++)
{
for (int x = 1; x <= 2; x++)
{
var rdbtn = myTbl.Rows[y].Cells[x].Controls[0];
//In intermediate window, when I do ?rdbtn, it return {Text = "Off" Checked = true}
//?rdbtn
//{Text = "Off" Checked = true} ...
Go to the complete details ...