How to dyanamic combo box using c# asp.netSyeada Sanjida Jahan9yAsked Sep 11, 2017, 10:49 PM EDT1 answerShareLinkedInXCopy linkSavehow to dyanamic list combo box and when i select a item in the mean time selected item related from opening using asp.net c# .please help me .
How to dyanamic combo box using c# asp.netSyeada Sanjida Jahan9yAsked Sep 11, 2017, 10:49 PM EDT1 answerShareLinkedInXCopy linkSavehow to dyanamic list combo box and when i select a item in the mean time selected item related from opening using asp.net c# .please help me .
Zakir AhamedRank #1,545 · 1K reputation9y agoPosted Sep 11, 2017, 11:32 PM EDT0 onclick="Button2_Click" /> Code Behind:protected System.Web.UI.WebControls.TextBox txtSkill; protected System.Web.UI.WebControls.TextBox txtVersion; protected void Page_Load(object sender, EventArgs e) { } int countTimes = 0; protected void Button1_Click(object sender, EventArgs e) { if (ViewState["countTimes"] == null) { countTimes = 1; } else { countTimes = Convert.ToInt32(ViewState["countTimes"]); } for (int i = 0; i < countTimes; i++) { txtSkill = new TextBox(); txtSkill.ID = "txtSkill" + i; txtVersion = new TextBox(); txtVersion.ID = "txtVersion" + i; form1.Controls.Add(txtSkill); form1.Controls.Add(txtVersion); } countTimes = countTimes + 1; ViewState.Add("countTimes", countTimes); } protected void Button2_Click(object sender, EventArgs e) { if (ViewState["countTimes"] == null) { countTimes = 1; } else { countTimes = Convert.ToInt32(ViewState["countTimes"]); } for (int i = 0; i < countTimes -1; i++) { txtSkill = new TextBox(); txtSkill.ID = "txtSkill" + i; txtVersion = new TextBox(); txtVersion.ID = "txtVersion" + i; form1.Controls.Add(txtSkill); form1.Controls.Add(txtVersion); } string storeToDbValueOne = ""; string storeToDbValueTwo = ""; for (int i = 0; i < countTimes; i++) { storeToDbValueOne += Request.Form["txtSkill" + i]; storeToDbValueOne += Request.Form["txtVersion" + i]; } Response.Write(""); }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 attend4days leftRegister
Zakir AhamedRank #1,545 · 1K reputationPosted Sep 11, 2017, 11:32 PM EDT
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts