怎样获取table中控件的属性或状态
我写了一个是学生给老师评分的页面,动态生成的table,有几个老师就有几行,评分涉及各个方面,每个表格里是3个radio单选按钮,代表不同的分值,只能选一个,但是我现在的问题是怎么才能知道学生选的是哪个radio按钮,也就是怎么获取
table中控件的属性或状态,这样我才能写入数据库,到底该怎么做??
另:用table.rows[].Cells[].innerText也不行啊
附上我的动态表格代码:
mycon = databaseConnection.DBCon();
int numrows;
int numcells;
int i = 0;
int j = 0;
int row = 0;
TableRow r;
TableCell c;
String b =
" <form id=\ "form1\ " name=\ "form1\ " method=\ "post\ " " +
"action=\ "\ "> <label> <input type=\ "radio\ " name=\ "radiobutton\ " " +
"value=\ "radiobutton\ " /> 1 </label> <p> <label> <input type=\ "radio\ " " +
"name=\ "radiobutton\ " value=\ "radiobutton\ " /> 2 </label> </p> </form> ";
String[] ITEM = new string[] { "1 ", "2 ", "3 ", "4 " };
DataSet ds = new DataSet();
mycon.Open();
String sql = "SELECT teachers.teacherName from teachers ";
SqlDataAdapter sda = new SqlDataAdapter(sql, mycon);
sda.Fill(ds, "temp ");
mycon.Close();
numrows = ds.Tables[ "temp "].Rows.Count + 1;
//产生表格
numcells = 4;
for (i = 0; i < numrows; i++)
{
r = new TableRow();
if (row