如何获取所有RedioButton并弹出当前被选中是RedioButton的值
2010-07-13 17:42:59 来源:WEB开发网核心提示:问:如何获取所有RedioButton并弹出当前被选中是RedioButton的值答:foreach (var c in Page.Form.Controls){ if (c is RadioButton) { RadioButton btn = c as RadioButton; if (btn.Checked) {
问:
如何获取所有RedioButton并弹出当前被选中是RedioButton的值
答:
foreach (var c in Page.Form.Controls)
{
if (c is RadioButton)
{
RadioButton btn = c as RadioButton;
if (btn.Checked)
{
Response.Write(btn.Text);
}
}
}
更多精彩
赞助商链接