I have a User Control which has a RadioButtonList on it.
<asp:RadioButtonList ID=rblMyOptions runat=server RepeatLayout=Flow
RepeatDirection=Horizontal >
<asp:ListItem Text=Yes Value=Y onClick=getCheckedRadio(true); />
<asp:ListItem Text=No Value=N onClick=getCheckedRadio(false); />
</asp:RadioButtonList>
As you can see I initially had an onClick event set to activate a JavaScript function, which this code was on a page it worked fine, but since moving to a user control it has stopped calling it.
The code has the following message: Validation (ASP.Net): Attribute 'onClick' is not a valid attribute of element 'ListItem'.
Is there anyway that I can have an onClick style event which will call my function? I have seen some examples which constantly iterate through the items and then determine which is selected, but I have lots of these radio buttons so would prefer not to use that if possible.