读书人

给单选按钮组中每个 项 添加Onclick J

发布时间: 2012-01-21 21:31:43 作者: rapoo

给单选按钮组中每个 项 添加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就可以加了

读书人网 >asp.net

热点推荐