c# - RadioButtonList SelectedIndexChanged event not fired when JS function onclick event is registered -


When I called the radio button list control, click the radio button, JavaScript function, but the server does not have side onchange event Get triggered I considered the "control" incident on this but did not work.

The first type -

  & lt; Asp: RadioButtonList id = "rdoRightPeriod" runat = "server" CssClass = "text" OnSelectedIndexChanged = "rdoRightPeriod_SelectedIndexChanged" AutoPostBack = "true" repetition direction = "horizontal" onclick = "return Sonk confirmed messageBox ()" & gt; & Lt; Asp: ListItem text = "year based" value = "y" & gt; & Lt; / Asp: ListItem & gt; & Lt; Asp: ListItem Text = "Perpetuity" Value = "P" & gt; & Lt; / Asp: ListItem & gt; & Lt; Asp: ListItem text = "base running" value = "r" & gt; & Lt; / Asp: ListItem & gt; & Lt; / ASP: RadioButtonList & gt;   

The second type

  & lt; Asp: RadioButtonList id = "rdoRightPeriod" runat = "server" CssClass = "text" OnSelectedIndexChanged = "rdoRightPeriod_SelectedIndexChanged" AutoPostBack = "true" Repeat direction = "horizontal" & gt; & Lt; ASP: ListItem text = "year based" value = "y" onclick = & gt; showConfirmMessageBoxNew () return "; & Lt; / ASP: ListItem & gt; & Lt; ASP: ListItem text = "eternal" value = "p" onclick = & gt; showConfirmMessageBoxNew () return "; & Lt; / ASP: ListItem & gt; & Lt; Asp: ListItem text = "move on" value = "R" onclick = & gt "showConfirmMessageBoxNew () return"; & Lt; / ASP: ListItem & gt; & Lt; / ASP: RadioButtonList & gt;   

I tried both of the above techniques, but the server-side code was not called. In

Instead of using OnClick, using OnClientClick.

Using OnClientClick, you used to run additional client side scripts along with server side events. Using the OnClick event, you have changed the call to the server event with your javascript.

Comments

Popular posts from this blog

php - how to change mysql_result($res, 0, "url"); to mysqli -

c# - Textbox not clickable but editable -

Matlab transpose a table vector -