How to insert radio button in dropdownMMas6yAsked Apr 2, 2020, 1:12 AM EDT5 answersShareLinkedInXCopy linkSaveHello Team, Need of some guideline for how to show the radio button in dropdown.. Please guide me!! thank you in advance!!
How to insert radio button in dropdownMMas6yAsked Apr 2, 2020, 1:12 AM EDT5 answersShareLinkedInXCopy linkSaveHello Team, Need of some guideline for how to show the radio button in dropdown.. Please guide me!! thank you in advance!!
Rajanikant HawaldarRank #110 · 20.2K reputation6y agoPosted Apr 2, 2020, 1:20 AM EDT0https://stackoverflow.com/questions/34666973/radio-button-inside-dropdown-bootstrap https://www.c-sharpcorner.com/UploadFile/33b051/checkbox-and-radio-button-inside-dropdownlist/ https://codepen.io/trinzia/pen/NNzxWp https://github.com/twbs/bootstrap/issues/20970
MMasRank #2,987 · 483 reputation6y agoPosted Apr 2, 2020, 1:48 AM EDT0Hi Rajanikant, I am trying to use the below code, But getting an error "The name ListBox1 doesn't exist in current context" using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.Data;using MySql.Data.MySqlClient;public partial class country : System.Web.UI.Page{ MySqlConnection con = new MySqlConnection("server=localhost;database=world;user=root;password=root;"); MySqlDataAdapter da; DataTable dt; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { fillListview(); } } public void fillListview() { da = new MySqlDataAdapter("select country from tbl_country", con); dt = new DataTable(); da.Fill(dt); ListBox1.DataSource = dt; ListBox1.DataTextField = dt.Columns["country"].ToString(); ListBox1.DataBind(); }} <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="dropdown.WebForm1" %> Name Select Country:- 0Rajanikant HawaldarRank #110 · 20.2K reputation6y agoPosted Apr 2, 2020, 2:34 AM EDT0Go through below link to fix this error => The name ListBox1 doesn't exist in current context https://stackoverflow.com/questions/23042903/codebehind-c-sharp-the-name-does-not-exist-in-the-current-context0Vinay SinghRank #604 · 4K reputation6y agoPosted Apr 2, 2020, 2:48 AM EDT0Hi Please check the link belowhttps://www.c-sharpcorner.com/UploadFile/33b051/checkbox-and-radio-button-inside-dropdownlist/ 0MMasRank #2,987 · 483 reputation6y agoPosted Apr 2, 2020, 5:33 AM EDT0Here I madae some changes in code, In the front end not able to view the data ...using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.Data;using MySql.Data.MySqlClient;public partial class country : System.Web.UI.Page{ MySqlConnection con = new MySqlConnection("server=localhost;database=world;user=root;password=root;"); MySqlDataAdapter da; DataTable dt; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { fillListview(); } } public void fillListview() { da = new MySqlDataAdapter("select country from tbl_country", con); dt = new DataTable(); da.Fill(dt); ListBox ListBox1 = new ListBox(); ListBox1.DataSource = dt; ListBox1.DataTextField = dt.Columns["country"].ToString(); ListBox1.DataBind(); }} 0Join to answer this questionEvery answer you publish earns 20 SHARP.Create free accountSign inKnow the answer?Answer a question in the forums and earn +20 SHARP for every answer.See unanswered questionsForumsTop experts01Arun PottiAnswers in the forums20answers02Tahir AnsariAnswers in the forums5answers03Kamlesh KumarAnswers in the forums5answers04Sam HobbsAnswers in the forums4answers05Željko PerićAnswers in the forums3answers?YouYour name goes here.Every answer: 20 SHARP.JoinFull leaderboard →2026DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Rajanikant HawaldarRank #110 · 20.2K reputation6y agoPosted Apr 2, 2020, 2:34 AM EDT0Go through below link to fix this error => The name ListBox1 doesn't exist in current context https://stackoverflow.com/questions/23042903/codebehind-c-sharp-the-name-does-not-exist-in-the-current-context0
Vinay SinghRank #604 · 4K reputation6y agoPosted Apr 2, 2020, 2:48 AM EDT0Hi Please check the link belowhttps://www.c-sharpcorner.com/UploadFile/33b051/checkbox-and-radio-button-inside-dropdownlist/ 0
MMasRank #2,987 · 483 reputation6y agoPosted Apr 2, 2020, 5:33 AM EDT0Here I madae some changes in code, In the front end not able to view the data ...using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.Data;using MySql.Data.MySqlClient;public partial class country : System.Web.UI.Page{ MySqlConnection con = new MySqlConnection("server=localhost;database=world;user=root;password=root;"); MySqlDataAdapter da; DataTable dt; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { fillListview(); } } public void fillListview() { da = new MySqlDataAdapter("select country from tbl_country", con); dt = new DataTable(); da.Fill(dt); ListBox ListBox1 = new ListBox(); ListBox1.DataSource = dt; ListBox1.DataTextField = dt.Columns["country"].ToString(); ListBox1.DataBind(); }} 0
Rajanikant HawaldarRank #110 · 20.2K reputationPosted Apr 2, 2020, 1:20 AM EDT
MasRank #2,987 · 483 reputationPosted Apr 2, 2020, 1:48 AM EDT
Rajanikant HawaldarRank #110 · 20.2K reputationPosted Apr 2, 2020, 2:34 AM EDT
Vinay SinghRank #604 · 4K reputationPosted Apr 2, 2020, 2:48 AM EDT
MasRank #2,987 · 483 reputationPosted Apr 2, 2020, 5:33 AM EDT
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts