Hi all,
I would like to know a way to add a label to an update panel by using a drop down list selected item.
For example:
There is a list of items in a drop down list, the user selects one then presses the add button next to it and it creates a label in a table next to it.
Here is the code I have at the moment:
-
protected void btAdd_Click(object sender, EventArgs e)
-
{
-
Label lblSelected = new Label();
-
lblSelected.Text = ddlAdd.SelectedItem.Text;
-
ddlAddingSales.Items.Remove(ddlAdd.SelectedItem);
-
UpdatePanel.ContentTemplateContainer.Controls.Add(lblSelected);
-
}
-
Of course with this way though it just keeps writing over the previously created label :(
Many thanks in advance.