我在asp.net中要用到几十个Radio Button控件(这个不是RadioButton控件),现在要 
对这些Radio Button进行循环判断,不知这样的C#代码怎么写? 还有就是如何表示“点击DataGrid中某一个单元格”,请高手指教,谢谢~

解决方案 »

  1.   

    private string s;
    protected void Condition(Control ctrl)
    {
    foreach (Control c in ctrl.Controls)
    {
    if(c is System.Web.UI.HtmlControls.HtmlInputRadioButton)
    {
    if(((System.Web.UI.HtmlControls.HtmlInputRadioButton)(c)).Checked==true)
    {
       s=((System.Web.UI.HtmlControls.HtmlInputRadioButton)(c)).Value;
    }
    }
    Condition(c);
    }
    }private void Button1_Click(object sender, System.EventArgs e)
    {
    Condition(this);
    Response.Write(s);
    }