you can use this to check if the exsits element is in the list or not ...
string checkitem = drp_branch.SelectedItem.Value + "-" + txt_acc_no.Text; if ((ListBox1.Items.Contains(checkitem) == true)) { Response.Write("Item exists"); } else { Response.Write("Item not exists"); }
source share