in this code label and text box show two time if i select one value than it show same name labels and show two text box,,,
protected void ddsize_SelectedIndexChanged(object sender, EventArgs e)
{
Panel1.Visible = true;
int Count = 0;
Count++;
foreach (ListItem item in ddsize.Items)
{
if (item.Selected)
{
for (int i = 0; i < Count; i++)
{
TextBox txt = new TextBox();
Label lbl = new Label();
lbl.Text = item.Text;
Panel1.Controls.Add(lbl);
Panel1.Controls.Add(txt);
}
}
}
}


Ranjit PowarRank #553 · 4.4K reputationPosted Jan 22, 2016, 10:12 PM EST
protected void ddsize_SelectedIndexChanged(object sender, EventArgs e)
{
Panel1.Visible = true;
int Count = 0;
Count++;
foreach (ListItem item in ddsize.Items)
{
if (item.Selected)
{
TextBox txt = new TextBox();
Label lbl = new Label();
lbl.Text = item.Text;
Panel1.Controls.Add(lbl);
Panel1.Controls.Add(txt);
}
}
}
If it helps you select it as correct answer
Aneez ARank #9,687 · 203 reputationPosted Jan 22, 2016, 9:22 PM EST
Devendra KumarRank #3,132 · 457 reputationPosted Jan 22, 2016, 9:23 PM EST
Devendra KumarRank #3,132 · 457 reputationPosted Jan 22, 2016, 9:26 PM EST
Devendra KumarRank #3,132 · 457 reputationPosted Jan 22, 2016, 9:28 PM EST
Ranjit PowarRank #553 · 4.4K reputationPosted Jan 22, 2016, 10:06 PM EST
Aneez ARank #9,687 · 203 reputationPosted Jan 22, 2016, 10:10 PM EST
Devendra KumarRank #3,132 · 457 reputationPosted Jan 22, 2016, 10:38 PM EST
Devendra KumarRank #3,132 · 457 reputationPosted Jan 22, 2016, 10:47 PM EST
Ranjit PowarRank #553 · 4.4K reputationPosted Jan 22, 2016, 11:04 PM EST