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')";
}}
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')";
}}
{
// 在此处放置用户代码以初始化页面
for(int i=0;i<RadioButtonList1.Items.Count;i++)
{
RadioButtonList1.Items[i].Attributes.Add("onclick","javascript:alert('xxx')");
}}好像应该是这样写的 你原来的属性组里面没有onclick成员要add进去