0
我在asp:table内部动态创建单选按钮。我想获取所选单选按钮的ID。检索asp中动态单选按钮控件的值:表
- 如何检查控制型
如何获得其ID。
RadioButton radioButton = new RadioButton(); radioButton.ID = id + "RadioButton"; radioButton.ToolTip = text; radioButton.Attributes.Add("id", id); radioButton.GroupName = categoryID + "Questions"; radioButton.EnableViewState = true; radioButton.AutoPostBack = true; radioButton.Checked = isSelected; radioButton.CssClass = style; TableCell cell = new TableCell(); cell.HorizontalAlign = HorizontalAlign.Left; cell.Controls.Add(radioButton); TableRow row = new TableRow(); row.Cells.Add(cell); table.Rows.Add(row);
你想在服务器端回发时获得身份证? – sll
看到这个帖子:[通过类型获取控件的所有子控件的位图](http://stackoverflow.com/q/7555309/485076) – sll