Hi I am trying to fire a javascript function from my .net radiobuttonlist but it does not fire. How do I fix this:
protected void Page_Load(object sender, EventArgs e)
{
this.rbl_NumberType.Attributes.Add("OnSelectedIndexChanged", "return NumberTypeChanged();");
}
...
function NumberTypeChanged()
{
alert("KJJK");
}
...
<asp:RadioButtonList ID="rbl_NumberType" runat="server">
<asp:ListItem Value="0" Selected="True">Somnething1</asp:ListItem>
<asp:ListItem Value="1">Somerthing2</asp:ListItem>
</asp:RadioButtonList>
If I replaces OnSelectedIndexChanged in the eventhandler to onClick it fires every time something is clicked but not on "OnSelectedIndexChanged".. What is wrong? onclick is not even an event in a radiobuttonlist but OnSelectedIndexChanged is..