日期:2014-05-19  浏览次数:20451 次

给单选按钮组中每个 项 添加Onclick JS事件,为什么添加不上???
protected   System.Web.UI.WebControls.RadioButtonList   RadioButtonList1;

private   void   Page_Load(object   sender,   System.EventArgs   e)
{
//   在此处放置用户代码以初始化页面
for(int   i=0;i <RadioButtonList1.Items.Count;i++)
{
  RadioButtonList1.Items[i].Attributes[ "onclick "]= "alert( 'xxxxx ') ";
}

}

------解决方案--------------------
.net有自己的处理方式,asp.net 2.0就可以加了