我正在尝试添加一个checkboxlist,然后为ASP.NET表中的每一行添加一个新复选框:
Dim cbList As New CheckBoxList
cbList.ID = "cb_list"
Dim c1 As New TableCell
Dim c2 As New TableCell
Dim r As New TableRow
c1.Controls.Add(New LiteralControl(dr.GetString(1)))
c2.Controls.Add(cbList.Items.Add("new cb")) 'error: expression does return a value
r.Cells.Add(c1)
r.Cells.Add(c2)
modaltable.Rows.Add(r)
c2.Controls行返回以下错误:
"表达式确实返回一个值"
我似乎无法解决这个问题。任何帮助表示赞赏!