J
Jimmy [Used-Disks]
How can I add an onclick client-side event to each ListItem in a
CheckBoxList? I tried iterating each item and adding an onclick attribute:
foreach(ListItem Item in this.MyCheckBoxList.Items){
Item.Attributes.Add("onclick", "alert('test')");
}
Though the attributes get added (I can see them in the debugger, write them
to a label, etcetera), they are not rendered to the page.
Is there a simple workaround for this? Should I just use a repeater and do
everything manually?
Thanks -
CheckBoxList? I tried iterating each item and adding an onclick attribute:
foreach(ListItem Item in this.MyCheckBoxList.Items){
Item.Attributes.Add("onclick", "alert('test')");
}
Though the attributes get added (I can see them in the debugger, write them
to a label, etcetera), they are not rendered to the page.
Is there a simple workaround for this? Should I just use a repeater and do
everything manually?
Thanks -