问题描述
foreach(tiliinlistTi){Labellbl=newLabel();lbl.Text=li.tiMu;panel.Controls.Add(lbl);panel.Controls.Add(newLiteralControl("<br/>"));for(chari='A';li.daAn.IndexOf("+")!=-1;i++){stringgetString=li.daAn.Substring(0,li.daAn.IndexOf("+"));intstringLength=getString.Length+1;li.daAn=li.daAn.Substring(stringLength,li.daAn.Length-stringLength);RadioButtonrb=newRadioButton();rb.ID=li.id.ToString()+i;rb.Text=getString;rb.GroupName="gn"+li.id;rb.CheckedChanged+=newEventHandler(rb_CheckedChanged);panel.Controls.Add(rb);panel.Controls.Add(newLiteralControl("<br/>"));}}}voidrb_CheckedChanged(objectsender,EventArgse){//无响应}
解决方案
解决方案二:
在Page_load中写添加控件的代码
时间: 2025-01-31 06:27:38