在asp.net中,有没有办法对一组名字有规则的控件赋值啊?
如有控件
protected System.Web.UI.WebControls.RadioButton RadioButton1;
protected System.Web.UI.WebControls.RadioButton RadioButton2;
protected System.Web.UI.WebControls.RadioButton RadioButton3;
protected System.Web.UI.WebControls.RadioButton RadioButton4;
protected System.Web.UI.WebControls.RadioButton RadioButton5;
protected System.Web.UI.WebControls.RadioButton RadioButton6;
protected System.Web.UI.WebControls.RadioButton RadioButton7;
protected System.Web.UI.WebControls.RadioButton RadioButton8;
protected System.Web.UI.WebControls.RadioButton Radiobutton9;
protected System.Web.UI.WebControls.RadioButton Radiobutton10;
还有一个字符串数组(string[] bt=new string[10];),共有10个值,有没有办法用循环来对实现下面的功能啊?
RadioButton1.text=bt[0];
RadioButton2.text=bt[1];
.
.
.
RadioButton10.text=bt[9];
控件赋值