title: RadioButtonList ListItem OnClick event?
body: <p>I have a User Control which has a RadioButtonList on it.</p>
  
  <pre><code>&lt;asp:RadioButtonList ID="rblMyOptions" runat="server" RepeatLayout="Flow"
  RepeatDirection="Horizontal"  &gt;
      &lt;asp:ListItem Text="Yes" Value="Y" onClick="getCheckedRadio(true);" /&gt;
      &lt;asp:ListItem Text="No" Value="N" onClick="getCheckedRadio(false);" /&gt;
  &lt;/asp:RadioButtonList&gt;
  </code></pre>
  
  <p>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.</p>
  
  <p>The code has the following message: "Validation (ASP.Net): Attribute 'onClick' is not a valid attribute of element 'ListItem'.</p>
  
  <p>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.</p>