1
Answer

Display multiple selected Items from DDL in Label

timothy.farrell

timothy.farrell

20y
1.8k
1
I have a webform that contains a dropdownlist with a list of users. Later on in the form I have a confirmation panel in which users can confirm the accuracy of their data before submitting. The problem I am having is that the label control is not listing all of the users selected from the dropdownlist control inteh webform. Here is the code for the ddl: Here is the code to populate the control from code-behind: SqlConnection Conn; SqlCommand Cmd; Conn = new SqlConnection("server=C099450d01;uid=sa;pwd=;database=tools"); Cmd = new SqlCommand("SELECT UID, LastName + ', ' + FirstName AS Name FROM Employee ORDER BY LastName", Conn); Conn.Open(); ActiveUsers.DataSource = Cmd.ExecuteReader(); ActiveUsers.DataTextField = "Name"; ActiveUsers.DataValueField = "Name"; ActiveUsers.DataBind(); Conn.Close(); Here is the code to populate the Label control in code-behind: lblActUsr.Text = ActiveUsers.SelectedItem.Value Can someone tell me why only one selection is appearing in the label control and how I can fix it. Thank you. Tim
Answers (1)