I’m working on an asp.net/C# application, and trying to get a radiobox to invoke a callback when any of the buttons on it is clicked. Does anyone know how to do this? I’ve tried this…
<asp:RadioButton id="id1" onclick="do_foo" runat="server" Text="Text1" GroupName="mybox" />
<asp:RadioButton id="id2" onclick="do_foo" runat="server" Text="Text2" GroupName="mybox" />
<asp:RadioButton id="id3" onclick="do_foo" runat="server" Text="Text3" GroupName="mybox" />
and also this…
<asp:RadioButtonList onclick="do_foo" id="radiolist1" runat="server">
<asp:ListItem>Text1</asp:ListItem>
<asp:ListItem>Text2</asp:ListItem>
<asp:ListItem>Text3</asp:ListItem>
</asp:RadioButtonList>
but in both cases get the error “Microsoft JScript runtime error: ‘do_foo’ is undefined”. I know that do_foo is defined because I can invoke it from a button.
Try this: