Vikas Singh

Vikas Singh

  • 1.3k
  • 410
  • 14.9k

Multi select DropDownList issue please help

Nov 26 2020 3:29 AM
Hello sir i have a dropdownlist i want to select multiple employees from the dropdown list this is working.
 
Now i want to assign the selected value in a string or hiddenfeild. Please help
 
here is a drop down list which is bind dynamically
  1. <asp:DropDownList runat="server" ID="ddlemployee" class="form-control select2" multiple="multiple"  
  2. data-placeholder="Select a State" >  
  3. </asp:DropDownList>  
  1. DataTable dtMember = objaccess.GetDatatable("select Emp_no,Emp_Name from Emptable");  
  2. if (dtMember.Rows.Count > 0)  
  3. {  
  4. ddlemployee.DataSource = dtMember;  
  5. ddlemployee.DataValueField = "Emp_no";  
  6. ddlemployee.DataTextField = "Emp_Name";  
  7. ddlemployee.DataBind();  
  8. }  
 
 

Answers (2)