How to get checked radio button value in Radiobuttonlist
-
Hi, am adding listitems to Radiobuttonlist dynamically. but when I click on button I didn't get selected item value. How to get selected radion button value during runtime(when click button). am using asp.net 2.0 and C#. pls see the below code. <asp:Panel ID="panelRecharge" runat="server"> <asp:RadioButtonList ID="rdlRechargeOptions" runat="server" > </asp:RadioButtonList> </asp:Panel> private void LoadRechargeOptions(VerifyPromotionResponse response) { ListItem li; if (response.ChargeAmount1 >0) { li = new ListItem(); li.Attributes.Clear(); li.Value = response.ChargeAmount1.ToString(); li.Text = response.CurrencyCode + response.ChargeAmount1.ToString(); rdlRechargeOptions.Items.Add(li); rdlRechargeOptions.RepeatDirection = RepeatDirection.Horizontal; } Thanks
-
Hi, am adding listitems to Radiobuttonlist dynamically. but when I click on button I didn't get selected item value. How to get selected radion button value during runtime(when click button). am using asp.net 2.0 and C#. pls see the below code. <asp:Panel ID="panelRecharge" runat="server"> <asp:RadioButtonList ID="rdlRechargeOptions" runat="server" > </asp:RadioButtonList> </asp:Panel> private void LoadRechargeOptions(VerifyPromotionResponse response) { ListItem li; if (response.ChargeAmount1 >0) { li = new ListItem(); li.Attributes.Clear(); li.Value = response.ChargeAmount1.ToString(); li.Text = response.CurrencyCode + response.ChargeAmount1.ToString(); rdlRechargeOptions.Items.Add(li); rdlRechargeOptions.RepeatDirection = RepeatDirection.Horizontal; } Thanks
-
chakran wrote:
but when I click on button I didn't get selected item value.
What did you get? And you did not post the click handler code :confused:
led mike
Hi, in my page there are two button. One is Validate and second is Next buttons. when I click Validate am calling LoadRechargeOptions() method. in this one am adding conrols dynamically to Radiobuttonlist. it is showing Radion buttons. when I selected radio button and click Next button here the selected radion button value is not coming... is there any solution..? Thanks.