首页 > 学院 > 开发设计 > 正文

如何获取所有RedioButton并弹出当前被选中是RedioButton的值

2019-11-17 03:40:29
字体:
来源:转载
供稿:网友

问:
如何获取所有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);
         }
      }
 }


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表