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