<asp:ListBox ID="ListBox1" SelectionMode="Multiple" runat="server"> |
private void GetSelectedItems()
{
string[] str = { "one", "three" };
foreach (string item in str)
{
for (int i = 0; i <= ListBox1.Items.Count - 1; i++)
{
if (ListBox1.Items[i].Text == item)
{ ListBox1.Items[i].Selected = true; }
}
}
}
Join the conversation! Your thoughts help the community grow.