Adding Dynamic Radio buttons in panel control
-
Hi, I am trying to add dynamic Radio buttons to 4 panel controls in a aspx. one panel control is on top adding dynamic radio buttons of recharge options. remaining panel controls is on below, containig payment options.am adding these options dynamically. but my problem is only one radio button is selected. but i want to select radion button in top panel control and select only one radion button in remainig 3 panels(payment options). pls see the code below. // Recharge Options panel control. Have to select one radio button. private void LoadRechargeOptions() { string strPath = Server.MapPath(CommonUIConstants.LANGUAGE_XML_FILE_FOLDER_NAME) + Path.DirectorySeparatorChar + CommonUIConstants.RECHARGE_OPTIONS; DataSet dsRechargeOptions = UtilityUIFunctions.GetPaymentMethodList(strPath); DataView dvForDisplay = dsRechargeOptions.Tables[0].DefaultView; string strCountryName = GetCountryName(); dvForDisplay.RowFilter = CommonUIConstants.COUNTRYNAME + "='" + strCountryName + "'"; HtmlInputRadioButton rdb = null; Label lbl = null; if (dvForDisplay.Count > 0) { for (int i = 0; i < dvForDisplay.Count; i++) { rdb = new HtmlInputRadioButton(); lbl = new Label(); rdb.ID = dvForDisplay[i]["RadioButtonId"].ToString(); rdb.Value = dvForDisplay[i]["RadioButtonText"].ToString(); lbl.Text = dvForDisplay[i]["RadioButtonText"].ToString(); rdb.Style.Add("border", "0px"); rdb.Attributes.Add("onClick", "javascript:AmountToCharge('" + rdb.Value + "','" + strQuoteCurrency + "');"); panelRechargeOptions.Controls.Add(rdb); panelRechargeOptions.Controls.Add(lbl); } } // Payment options panel controls. here there are 3 panel controls. in these 3 panel controls have to select only one radio button. private void LoadPaymentMethods() { string strPath = Server.MapPath(CommonUIConstants.LANGUAGE_XML_FILE_FOLDER_NAME) + Path.DirectorySeparatorChar + CommonUIConstants.PAYMENT_METHODS; DataSet dsPaymentMethods = UtilityUIFunctions.GetPaymentMethodList(strPath); DataView dvForDisplay = dsPaymentMethods.Tables[0].DefaultView; string strCountryName = GetCountryName(); dvForDisplay.RowFilter = CommonUIConstants.COUNTRYNAME + "='" + strCountryName + "'";